aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Newbie just trying to change icon image in a Jframe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Newbie just trying to change icon image in a Jframe" Watch "Newbie just trying to change icon image in a Jframe" New topic
Author

Newbie just trying to change icon image in a Jframe

Dick Hammer
Greenhorn

Joined: Jan 28, 2012
Posts: 18
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

Joined: May 03, 2008
Posts: 4522
    
    5

Please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/new-java/54696-newbie-just-trying-change-icon-image-jframe.html


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Newbie just trying to change icon image in a Jframe
 
Similar Threads
Networked Programs that work across countries
problem clicking jbuttons in jtable
requestfocusinwindow going to lostfocus event thrice
Symbol Not Found - What am I Missing?
Problem With GUI of Net Beans