Images not visible in applet

Dear all

I have this applet for which i designed a toolbar.This toolbar has image icons that display some of the more used controlls. When i test it inside Eclipse i can see if perfectrly. But when i load it inside a browser i get some unexpected behaviour. The images for the image icons that are supposed to be in the tool bar are not visible. I checked the console output but it doesnt give me any permission errors. In the policy file that i placed in the same directory as the .html file i said to give all permisions.

Is there anything i am missing? (My images are in a diferent subdirectory then the ones where the class files are)

I know it is some sort of permission problem but dont know how to work it out. I tried by creating a signed applet too. But i think there must be something i am doing wrong.

Cheers

Dan

[860 byte] By [DanDanAUSa] at [2007-10-3 10:52:12]
# 1

Hey,

are you getting the images by the (J)Applet class method .getImage(..) ? This method returns always an correct image object, either the files were found or not... When the images are set to visible ( .setVisible(true) to the parent ) the applet gets the images from the path. So it is getting the stuff on demand...

maybe this information helped you a bit.

Greets.

SpecialAgenta at 2007-7-15 6:17:39 > top of Java-index,Desktop,Core GUI APIs...
# 2

This is the code i am using to set the image for the button:

JToggleButton eraser = new JToggleButton( new ImageIcon("ToolbarIcons/eraser.JPG"));

eraser.setMargin(new Insets(0,0,0,0));

The result i get is the button with all the functionality but it is totaly grayed out without the image. So i am guessing the image does not get loaded.

And the second instance where i am getting the images is :

Toolkit tk = Toolkit.getDefaultToolkit();

Image img1 = tk.getImage("Cursors/rubbermouse.gif");

I am using the second case to load some images and cursors.

Cheers

Dan

DanDanAUSa at 2007-7-15 6:17:39 > top of Java-index,Desktop,Core GUI APIs...