Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set title bar icon in swing

Status
Not open for further replies.

DixieFlatline

Programmer
Aug 2, 2000
57
CA
Hi,

Anyone know how to set the title bar icon in a swing app?

Thanks.
 
Method is extended from fram I think so will be

JFrame window=new JFrame();
window.setIconImage(Image 'Whatever the image file is');

Phil

hope this is what you mean
;-)

 
This is what I thought too, but when I tried it, nothing happened...
 
Pressume its like everything else in swing (EVIL!) and needs setting to vissible or something, will look later on as a bit busy right now
 
This project does, and philrobo swing is awesome ;-), if think it may be a problem with your image. You cannot use .ico files like in windows, you must use .jpg or .gif.

here is part of code, the rest is in url listed above.....
Code:
Toolkit tk = Toolkit.getDefaultToolkit();
Image img = tk.getImage("cursor.gif");
setIconImage(img);
ackka
ackka@mad.scientist.com
duke_wave.gif
Java is the Future
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top