org.jperdian.swing.tools
Class SwingHelper

java.lang.Object
  |
  +--org.jperdian.swing.tools.SwingHelper

public class SwingHelper
extends java.lang.Object

Some static helper methods for working with Swing objects

Author:
Christian Robert

Constructor Summary
SwingHelper()
           
 
Method Summary
static javax.swing.JButton createButton(javax.swing.Action action)
          Creates a new JButton that has no icon associated with it
static javax.swing.JButton createButton(javax.swing.Action action, javax.swing.Icon icon)
          Creates a new JButton that might have an icon associated with it
static javax.swing.JButton createButton(javax.swing.Action action, javax.swing.Icon icon, char shortChar)
          Creates a new JButton that might have an icon associated with it
static javax.swing.JButton createButton(javax.swing.Action action, java.lang.String resourceIconPath)
          Creates a new JButton that might have an icon associated with it
static javax.swing.JButton createButton(javax.swing.Action action, java.lang.String resourceIconPath, char shortChar)
          Creates a new JButton that might have an icon associated with it
static javax.swing.JMenuItem createMenuItem(javax.swing.Action action)
          Creates a new JMenuItem that has no icon associated with it
static javax.swing.JMenuItem createMenuItem(javax.swing.Action action, javax.swing.Icon icon)
          Creates a new JMenuItem that might have an icon associated with it
static javax.swing.JMenuItem createMenuItem(javax.swing.Action action, javax.swing.Icon icon, char shortChar)
          Creates a new JMenuItem that might have an icon associated with it
static javax.swing.JMenuItem createMenuItem(javax.swing.Action action, java.lang.String resourceIconPath)
          Creates a new JMenuItem that has no icon associated with it
static javax.swing.JMenuItem createMenuItem(javax.swing.Action action, java.lang.String resourceIconPath, char shortChar)
          Creates a new JMenuItem that has no icon associated with it
static javax.swing.ImageIcon loadIconResource(java.lang.String resourcePath)
          Creates a new Icon with the image that has been read from a system resource
static java.awt.Image loadImageResource(java.lang.String resourcePath)
          Creates a new Image with the image that has been read from a system resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingHelper

public SwingHelper()
Method Detail

loadIconResource

public static javax.swing.ImageIcon loadIconResource(java.lang.String resourcePath)
Creates a new Icon with the image that has been read from a system resource

Parameters:
resourcePath - the path from which to load the image

loadImageResource

public static java.awt.Image loadImageResource(java.lang.String resourcePath)
Creates a new Image with the image that has been read from a system resource

Parameters:
resourcePath - the path from which to load the image

createButton

public static javax.swing.JButton createButton(javax.swing.Action action)
Creates a new JButton that has no icon associated with it


createButton

public static javax.swing.JButton createButton(javax.swing.Action action,
                                               java.lang.String resourceIconPath)
Creates a new JButton that might have an icon associated with it


createButton

public static javax.swing.JButton createButton(javax.swing.Action action,
                                               java.lang.String resourceIconPath,
                                               char shortChar)
Creates a new JButton that might have an icon associated with it


createButton

public static javax.swing.JButton createButton(javax.swing.Action action,
                                               javax.swing.Icon icon)
Creates a new JButton that might have an icon associated with it


createButton

public static javax.swing.JButton createButton(javax.swing.Action action,
                                               javax.swing.Icon icon,
                                               char shortChar)
Creates a new JButton that might have an icon associated with it


createMenuItem

public static javax.swing.JMenuItem createMenuItem(javax.swing.Action action,
                                                   java.lang.String resourceIconPath)
Creates a new JMenuItem that has no icon associated with it


createMenuItem

public static javax.swing.JMenuItem createMenuItem(javax.swing.Action action,
                                                   java.lang.String resourceIconPath,
                                                   char shortChar)
Creates a new JMenuItem that has no icon associated with it


createMenuItem

public static javax.swing.JMenuItem createMenuItem(javax.swing.Action action)
Creates a new JMenuItem that has no icon associated with it


createMenuItem

public static javax.swing.JMenuItem createMenuItem(javax.swing.Action action,
                                                   javax.swing.Icon icon)
Creates a new JMenuItem that might have an icon associated with it


createMenuItem

public static javax.swing.JMenuItem createMenuItem(javax.swing.Action action,
                                                   javax.swing.Icon icon,
                                                   char shortChar)
Creates a new JMenuItem that might have an icon associated with it