i am going to create an applet jar which has a JFileChooser open dialog. and i want to change its icon.
frame = parentFrame;
ImageIcon icon = new ImageIcon("com/biztree/docmntui/client/applet/favicon.gif");
frame.setIconImage(icon.getImage());
and then
int returnVal = fileChooser.showOpenDialog(frame);
it works fine when i run it as applet.
but when i trying to run it in GWT web page its shows java default icon.
The
Stringbased constructor for anImageIconinterprets the string as aFilepath. I doubt that would work with GWT. It is probably expecting to deal with the resource byURL. To get an URL, do something like:Use the
URLinstead of theStringin theImageIconconstructor.