Results 1 to 5 of 5
  1. #1
    nfteodoro is offline Member
    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Default Problem deploying applet to browser

    Hi all, i am with a problem when deploying an applet to a web browser.

    i am using netbeans 6.7.1, JDK 6 Update 16 with Java EE and IE 8 [or firefox 3.5.3].

    I've created a JApplet Form and then in the self generated .html file with <applet> tags, i can deploy the applet to the IE8.
    T
    he thing is i need to put a picture in the applet. waht i did was to create a label, remove it's text and seted a icon with the image. I can run the applet fine and everything is ok. When i go to the .html file and deploy it to the browser, i get a gray image with the size of the applet but completly...dead, only gray, no controls, no image, no nothing.

    It this a known bug or what?

    Thank you for your help guys!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Where is the image file in relation to your class files? Is it held within the Jar file? Are you getting the image as a resource and not as a file?

  3. #3
    nfteodoro is offline Member
    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Default

    i've created a folder "Images" in the root of the project. then i simply added a label to the applet form and made something like:

    jLabel10.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\user\\My Documents\\NetBeansProjects\\App\\Images\\image.pn g"));

    So i really dont know how to answer you, what do you mean by" held within the Jar" and "getting the image as a resource and not as a file" ?

    I'm getting this image as an external image, searching it from a url in my computer file system

  4. #4
    Supamagier is offline Senior Member
    Join Date
    Aug 2008
    Posts
    384
    Rep Power
    7

    Default

    Probably a security exception. Have a look at the console, what it prints (It should be one of those icons in the lower right corner)

    To fix it, you have to give permission to the applet, adding some kind of security file. Google a bit on how to do that, I'm not familiar with that. :)

    (If you can't find the console, try running it in the applet viewer. If it works in there, it's a security exception)
    I die a little on the inside...
    Every time I get shot.

  5. #5
    nfteodoro is offline Member
    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Default

    Actually, the browser blocks the content but after i give permission to display it, i only get a grey area, and not any error, what makes me think that the browser is supporting and loading the applet but something is wrong. The browser console shows no errors or warnings for this application..
    Last edited by nfteodoro; 09-25-2009 at 10:05 AM.

Similar Threads

  1. Applet Slideshow in web browser
    By Urgle in forum New To Java
    Replies: 0
    Last Post: 12-01-2008, 04:30 AM
  2. Problem with applet, between appletviewer and browser
    By Goodwine in forum Java Applets
    Replies: 0
    Last Post: 11-30-2008, 03:09 AM
  3. applet won't run in browser...
    By shwein in forum Java Applets
    Replies: 6
    Last Post: 10-17-2008, 06:24 PM
  4. Replies: 2
    Last Post: 09-23-2008, 01:00 PM
  5. Having problem hot-deploying JSP's
    By kurt_cobain in forum Eclipse
    Replies: 0
    Last Post: 04-03-2008, 05:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •