Hi to all!
Sorry, maybe this is not the right
thread where I have to post this question!
I'm using java.beans.XMLEncoder and java.beans.Decoder to save the content of a frame (JFrame)in a XML file, and after this I want to rebuild the frame. My problem is that I have some JButtons with icons, and XML part for a button looks like:
<object class="javax.swing.JButton">
<
string>jButton1</string>
<void property="enabled">
<boolean>false</boolean>
</void>
<void property="icon">
<object class="javax.swing.ImageIcon">
<string>file:/C:/temp/project_name/resource/button/Close.gif</string>
</object>
</void>
</object>
So I have the path to the image file here. The problem is that when I'm trying to display the frame, rebuilding with XMLDecoder, the icon doesn't appear. If I'm chaging: "file:/C:/temp/project_name/resource/button/Close.gif" to "C:/temp/project_name/resource/button/Close.gif" in the XML file, then everything is ok.
Does anybody know why doesn't work before I change this line?
Thx in advance!
:roll:
P.S.: If I have the images in a jar file that line looks like: "jar:file:/D:/project_name/project_name.jar!/project_name/resource/button/Close.gif