|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Which default icons are available I try to create a simple JButton with an arrow icon that shall look the same as the arrow buttons in for instance the JScrollPane and JComboBox. I've found something like UIManager.getIcon( "Some icon string" ) but which icon strings are available to me? Is this the right way to copy the look of another component? |
#2
| |||
| |||
Re: Which default icons are available This is not documented anywhere. In general, there is no reliable API to get internal icons, especially not in a PLAF-independent way. You can get the UIDefaults via the UIManager and print all the defaults (it is a Map). There is e.g. a small tool called ShowUIDefaults.java out there doing this with a GUI. This list will contain among other things the icon key/value pairs, so you will see which ones are available for the current PLAF. But another PLAF or another VM implementation might provide a completely different set of icons, or no icons at all. If you want to deal with Metal only, you can use javax.swing.plaf.metal.MetalIconFactory to get Metal-Related icons. This is at least a public API, although not a really good one. You could also snoop round in the javax.swing.plaf.basic.BasicIconFactory for some more icons.
__________________ The FIFA Manager 2009 PC Game |
#3
| |||
| |||
Re: Which default icons are available Ok, thanks. I'll check that out. |
#4
| |||
| |||
Re: Which default icons are available This page (http://forums.sun.com/thread.jspa?threadID=5338038) has some code sample that shows the default values for a given theme, thus teling which icon strings it supports. For the Nimbus look and feel, I got this info: Tree.collapsedIcon FileChooser.directoryIcon FileChooser.detailsViewIcon OptionPane.questionIcon FileChooser.newFolderIcon FileView.floppyDriveIcon Tree.openIcon Tree.expandedIcon OptionPane.informationIcon Tree.closedIcon Tree.leafIcon FileChooser.upFolderIcon OptionPane.errorIcon ToolBar.handleIcon FileChooser.floppyDriveIcon FileChooser.fileIcon RadioButton.icon FileView.fileIcon Haven't tested all values though. |
![]() |
|
Tags: available, default, icons |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Not able to Locate Default Icons | Obessed | Windows Software | 3 | 10-11-2010 07:01 AM |
Making medium icons the default style | Esmel | Windows Software | 6 | 10-09-2010 10:46 PM |
Java program to remove JTree default icons? | Baazigar | Software Development | 4 | 22-01-2010 07:35 PM |
How to change Vista default folder icons? | Abhav | Customize Desktop | 4 | 17-06-2009 05:58 AM |
Restore Windows Default Icons | ChrisUlrich | Customize Desktop | 2 | 25-03-2009 01:55 PM |