Newbie just trying to change icon image in a Jframe
posted 4 years ago
I used Netbeans drag and drop design interface and it spit out this code: (I know some basic Java, but hardly any Swing or Jframe stuff, although I did read a few chapters from Dietel & Deitel book (actually, many chapters). Seems it should be pretty easy but I am not sure exactly how to go about it. The code it generated has setIcon() as part of a private function...I've looked up repaint? and others but the example they gave were not clear to me.
I figure I can make a function that does setIcon()? Not exactly sure to do it though. How do I add programming to change the image Viper-Green.jpg (to another image in same directory called Viper-Orange.jpg)?
I solved my own "problem". Ha, spent a few hours googling changing an image on Jframe, all I had to do was fiddle with the code.
seems to work. hmm it seemed it had not worked earlier.
***Now my question is though: I figure this is not buffered? So every time I load a new image is the old image being discarded or staying in memory?