Results 1 to 4 of 4

Thread: Which default icons are available

  1. #1
    Join Date
    Oct 2008
    Posts
    37

    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. #2
    Join Date
    May 2008
    Posts
    2,389

    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.

  3. #3
    Join Date
    Oct 2008
    Posts
    37

    Re: Which default icons are available

    Ok, thanks. I'll check that out.

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    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.

Similar Threads

  1. Not able to Locate Default Icons
    By Obessed in forum Windows Software
    Replies: 3
    Last Post: 10-11-2010, 07:01 AM
  2. Making medium icons the default style
    By Esmel in forum Windows Software
    Replies: 6
    Last Post: 10-09-2010, 10:46 PM
  3. Java program to remove JTree default icons?
    By Baazigar in forum Software Development
    Replies: 4
    Last Post: 22-01-2010, 07:35 PM
  4. How to change Vista default folder icons?
    By Abhav in forum Customize Desktop
    Replies: 4
    Last Post: 17-06-2009, 05:58 AM
  5. Restore Windows Default Icons
    By ChrisUlrich in forum Customize Desktop
    Replies: 2
    Last Post: 25-03-2009, 01:55 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,908,578.98874 seconds with 17 queries