jQuery in Action, 2nd edition*
The moose likes Swing / AWT / SWT and the fly likes Icons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Icons" Watch "Icons" New topic
Author

Icons

Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
I am trying to add standard icons to specific JMenuItem. ie a disk icon to Save, scissors to cut, ect.

Do these icons come with java, if so how do I access them? Or do I need to find free ones online and add them? I found a bunch of icons from sun under documents and settings, but most are of the emoticon type.

Also, how can I change the icon on the top bar, the coffee cup, to a custom icon?
[ June 25, 2006: Message edited by: Rusty Shackleford ]

"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> how can I change the icon on the top bar, the coffee cup, to a custom icon?

frame.setIconImage(new ImageIcon("test.gif").getImage());

for the icons, search your files for save.gif, java has some under demo/...
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
Thank you

Any idea on how to change the coffee cup?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
this didn't work?

frame.setIconImage(new ImageIcon("test.gif").getImage());
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
It did, thanks alot! Slight typo I missed.
Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243
Hi,

Originally posted by Rusty Shackleford:

Do these icons come with java, if so how do I access them? Or do I need to find free ones online and add them? I found a bunch of icons from sun under documents and settings, but most are of the emoticon type.


Sun has a free repository of icons that they encourage you to use for consistency across Java GUI applications. You might like to have a look here to see if it has what you need:

http://java.sun.com/developer/techDocs/hi/repository/

Cheers, Jared.


SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Icons