In general, you should probably use java.io.File.Separator instead of hardcoded forward-slash and back-slash, especially if you want to retain cross-platform capability.
Also, you will want to keep your drive letter and base directory path separate, so you don't have to change the hardcoded names everywhere. You can just change them in one place. Or, better yet, read them from a properties file or from the start-up command.
e.g.
1 2 3 4 5 6 7 8
| import java.io.File;
...
String baseDrive = "C:"; String basePath = "mygame";
String filename = baseDrive + File.Separator + basePath + "images" + File.Separator + "back.jpg"; |
So, on your PC, it might be:
[size=2]C:\mygame\images\back.jpg[/size]On the Linux server, it could be something like:
[size=2]/home/dude/gameserver/images/back.jpg[/size]