public class ComponentHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
IMAGES
the default directories for images
|
Constructor and Description |
---|
ComponentHelper() |
Modifier and Type | Method and Description |
---|---|
static java.awt.Image |
getImage(java.lang.String filename)
returns the Image for a given filename, NULL if not successful
|
static java.awt.Image |
getImage(java.lang.String dir,
java.lang.String filename)
returns the Image for a given directory and filename, NULL if not successful
|
static javax.swing.ImageIcon |
getImageIcon(java.lang.String filename)
returns the ImageIcon for a given filename, NULL if not successful
|
static javax.swing.ImageIcon |
getImageIcon(java.lang.String dir,
java.lang.String filename)
returns the ImageIcon for a given filename and directory, NULL if not successful
|
static void |
showInformationBox(java.awt.Component parent,
java.lang.String title,
java.lang.String msg,
int messageType)
displays a message box with the given title, message, buttons and icon
ant the dimension.
|
static java.lang.String |
showInputBox(java.awt.Component parent,
java.lang.String title,
java.lang.String msg,
java.lang.Object initialValue)
pops up an input dialog
|
static int |
showMessageBox(java.awt.Component parent,
java.lang.String title,
java.lang.String msg,
int buttons,
int messageType)
displays a message box with the given title, message, buttons and icon
ant the dimension.
|
public static final java.lang.String[] IMAGES
public static javax.swing.ImageIcon getImageIcon(java.lang.String dir, java.lang.String filename)
dir
- the directory to look in for the filefilename
- the file to retrievepublic static javax.swing.ImageIcon getImageIcon(java.lang.String filename)
filename
- the file to retrievepublic static java.awt.Image getImage(java.lang.String dir, java.lang.String filename)
dir
- the directory to look in for the filefilename
- the file to retrievepublic static java.awt.Image getImage(java.lang.String filename)
filename
- the file to retrievepublic static int showMessageBox(java.awt.Component parent, java.lang.String title, java.lang.String msg, int buttons, int messageType)
parent
- the parent componenttitle
- the title of the message boxmsg
- the text to displaybuttons
- the captions of the buttons to displaymessageType
- the type of message like defined in JOptionPane
(the icon is determined on this basis)JOptionPane
public static void showInformationBox(java.awt.Component parent, java.lang.String title, java.lang.String msg, int messageType)
parent
- the parent componenttitle
- the title of the message boxmsg
- the text to displaymessageType
- the type of message like defined in JOptionPane
(the icon is determined on this basis)JOptionPane
public static java.lang.String showInputBox(java.awt.Component parent, java.lang.String title, java.lang.String msg, java.lang.Object initialValue)
parent
- the parent of this dialog, can be null
title
- the title to display, can be null
msg
- the message to displayinitialValue
- the initial value to display as inputnull