I'm currently working through a java swing tutorial, but when I get done I'll come back and work on implementing this.
EDIT: So I was in the middle of typing a message to you explaining why I didn't get what was going on, when I figured it out! So now I have terribly large pictures of ships, but it worked! Once I learn better gui stuff I'll work on resizing them, but for now I'll clean up the code and push it to GitHub. Thank you so much for helping me with that part!
Vhati wrote:Tip: An ImageIcon that's constructed directly from a path-string caches the image... somewhere. In big apps, it can be inconvenient to later clear old images (link, more info). So I try to avoid that method.
ImageIO.read() doesn't do that. Each read() returns a unique image object that dies on its own when abandoned (When a cache is needed, a HashMap<String,BufferedImage> will suffice).
More relevant to your project, ImageIO can read a stream from DataManager.
Pics like the Krestel ship will be used over and over again in all likelihood as the player probably will have a lot of the same ship saves, so I shouldn't buffer them, but I should cache them, correct? (Or do I need to buffer them in order to cache them!?) I've made a background that I'm going to try to display that's the size of the ship select background (1280 by 700 or so), so I'll definitely buffer that guy.
EDIT: Here's a shot of the progress. It's coming along!!!