Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: applet img

  1. #1
    Member wolfgar's Avatar
    Join Date
    Oct 2009
    Location
    the middle of the woods
    Posts
    89
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default applet img

    yet again i am at a stand still in my applet ><
    but this time i know exactly the problem and what i need
    to know to fix it

    i need to know how to load a image from a url w/o
    being slapped in the face with a security exception
    Programming: the art that fights back


  2. #2
    Member wolfgar's Avatar
    Join Date
    Oct 2009
    Location
    the middle of the woods
    Posts
    89
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: applet img

    .... nothing ?
    not even info on how to use the java securityManager?
    Programming: the art that fights back

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: applet img

    Can you ship the image with the applet in a jar? This would overcome the security exception and you can load the image from your app. If you must load it externally, you most likely will have to sign the applet (buy one or see Signed Applets - How to sign an applet (and get it to work) ).

    Loading the image from the app:

    URL url = getClass().getResource("/image.jpg");

    where the path of the image is inside your jar and relative to your class/package.

  4. #4
    Member wolfgar's Avatar
    Join Date
    Oct 2009
    Location
    the middle of the woods
    Posts
    89
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: applet img

    while the first 2 ideas would work it would either make the html or the jar huge , as i need to be able to load over 5000 diffrent pics ( only 2 active at once depending on the choices made ) i have signed the applet but i'm still having problems loading pics with it . link to the applet

    i saw a way similar to that but decided to go with the full url instead
    do u know if this would work w/o needing signing ?
    URL url = new URL(//somthing that returned the applets url + /relative path& location of pic);

    the entire thing is setup as
    page 
       |
        --Applets
             |
             |--- .jar
              --- resources
                         | 
                          --- pics
                                 |
                                  --- pic type ( many of these )
                                            |
                                             --- pic ( about 30 in each above folder )
    Last edited by wolfgar; April 6th, 2010 at 12:02 AM.
    Programming: the art that fights back

  5. #5
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: applet img

    Quote Originally Posted by wolfgar View Post
    do u know if this would work w/o needing signing ?
    URL url = new URL(//somthing that returned the applets url + /relative path& location of pic);
    \
    Off the top of my head no. Is there any way to decrease the number of images? I briefly looked at the applet, didn't see any images show up but based upon the selections my guess is you could somehow overlay the colors onto a 'template' image which - if possible - could reduct the number of images considerably

  6. #6
    Member wolfgar's Avatar
    Join Date
    Oct 2009
    Location
    the middle of the woods
    Posts
    89
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: applet img

    if i was the 1 that made the images i could , but i just DL the images from ernya ( the place i made the shop to work for )
    Programming: the art that fights back

Similar Threads

  1. applet menubar
    By tabutcher in forum Java Applets
    Replies: 2
    Last Post: March 5th, 2010, 09:30 AM
  2. Deploying an applet with jsp
    By IamKira in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: January 27th, 2010, 08:28 AM
  3. applet fail
    By wolfgar in forum What's Wrong With My Code?
    Replies: 7
    Last Post: January 21st, 2010, 06:24 AM
  4. [SOLVED] applet vs. gui app
    By rptech in forum AWT / Java Swing
    Replies: 3
    Last Post: August 27th, 2009, 09:13 AM
  5. Problem of implementing mathematic logic in Java applet
    By AnithaBabu1 in forum Java Applets
    Replies: 0
    Last Post: August 15th, 2008, 11:42 PM