Read a couple forums posts on setting the application icon... (ie replacing the java icon)...
I'm using the code, but its just not working... I have the worldicon.png in the same package this code is running in. Does it need to be in resources or am I using the wrong call?
mainScreen = new MainScreen(mainScreenDriver);
Do you know for a fact that you're looking in the right place for the "worldicon.png" file? If I didn't know, I'd create the image icon in a separate step and test if it's null or not. You know of course that java is looking at the System.getProperty("user.dir") location for your file.
for instance place this line in your code to see just where Java is looking for the png file:
Also, if there's any chance that you'll want to make a JAR out of this, use resources, not files. And of course resources will start looking at a different location from the user.dir, but rather will look at the location of your class files.
Also, it's rather silly to construct an ImageIcon just to retrieve its Image. Use ImageIO#read (or Toolkit#createImage)