|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.swing.SwingUtils
Collection of static utility methods for working with swing guis.
Method Summary | |
static void |
loadButtonIcon(JButton button,
String iconFilename,
String defaultText)
Attempts to load an image icon from the given file and stick it on the given button. |
static ImageIcon |
loadImageIcon(String iconFilename)
Loads the given icon image as a system resource and returns a new ImageIcon. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void loadButtonIcon(JButton button, String iconFilename, String defaultText)
loadImageIcon(java.lang.String)
).
Standard icons from Sun are included in the JavaNLP libraries as jlfgr-1_0.jar.
public static ImageIcon loadImageIcon(String iconFilename)
JButton openButton = new JButton(); openButton.setIcon(SwingUtils.loadImageIcon("toolbarButtonGraphics/general/Open16.gif"));For the special case of trying to load an icon for a button and defaulting a text label instead, consider using
loadButtonIcon(javax.swing.JButton, java.lang.String, java.lang.String)
(also contains
a more detailed explanation of why you should use system resources).
Standard icons from Sun are included in the JavaNLP libraries as jlfgr-1_0.jar.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |