Well i’ve got a simple doubt regarding the behaviour of instance of a java.swing.ImageIcon class.
Now it is based on RMI Client server operation……
Suppose there exist a jpg file called A.jpg in server computer.
Now on retrieving it using
// At Server...
ImageIcon ic = new ImageIcon("C://server_image_folder//A.jpg");
return ic;
and then using it in client with the function
// At Client....
// same variable name used for simplicity....
System.out.print(ic);
We’ll observe here that it prints the URL of the image file in the server computer..
Here, for eg: – C:/server_image_folder/A.jpg
So my question is just simply….
Will it cause any trouble since such URL don't exist in client computer ?
such problem cannot be observed in a a situation like localhost since both share the same URL( i believe ).
But, What about the condition when both programs are implemented in separate computers….??
This doesn’t cause a problem, but may result in some confusion. The constructor that you’re using treats the single arg as both a file name and a description. The
filenamefield is transient, so it is not part of the serialized data. However, thedescriptionfield is not transient and will be part of the serialized data. Since thetoStringmethod will return thedescriptionfield if it’s non-null, it might lead you to think that the file name has been retained as well, but it hasn’t.