Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie just trying to change icon image in a Jframe

 
Dick Hammer
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Darryl Burke
Bartender
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/new-java/54696-newbie-just-trying-change-icon-image-jframe.html
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic