|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.util.gui.Menus
public final class Menus
Menus provides some convenient menus and dialogs that are potentially useful for any Java Swing Application. If available, it takes advantage of com.incors.plaf.kunststoff.KunststoffLookAndFeel and com.jgoodies.looks.
| Field Summary | |
|---|---|
static String |
aboutString
|
static ImageIcon |
antelmannIcon
|
| Constructor Summary | |
|---|---|
Menus()
|
|
| Method Summary | |
|---|---|
static void |
center(Component c)
centers the given Component in the middle of the screen |
static JMenuItem |
createAboutBoxMenuItem(Frame parent)
returns an 'about' menu capable of displaying an Antelmann.com's info box. |
static JMenuItem |
createAboutDialogMenuItem(Frame parent)
returns an 'about' menu capable of displaying an Antelmann.com's info box. |
static JMenuBar |
createDefaultMenuBar(Frame parent)
returns a convenient standard JMenuBar to be used with any Frame |
static JDialog |
createDialog(Component parent,
String title,
boolean modal)
|
static JMenu |
createLookAndFeelMenu(Frame rootComponent)
createLookAndFeelMenu() generates a JMenu that lets the user select from different look&feel options. |
static char[] |
enterPassword(Component parent)
returns null on cancel |
static char[] |
enterPassword(Component parent,
String title,
Object message,
String initialValue)
returns null on cancel |
static char[] |
enterPassword(Component parent,
String title,
Object message,
String initialValue,
ImageIcon icon)
returns null on cancel; tries to set caps lock to false to avoid common mistakes |
static Dialog |
getDialogForComponent(Component component)
|
static ResourceBundle |
getLanguage(Locale l)
returns a newly generated language bundle based on the given locale |
static boolean |
isCapsLockOn()
|
static ResourceBundle |
language()
provides access to the Locale specific language used in this package |
static void |
makeCompactSpringGrid(Container parent,
int rows,
int cols,
int initialX,
int initialY,
int xPad,
int yPad)
Aligns the first rows * cols
components of parent in
a grid. |
static void |
makeSpringGrid(Container parent,
int rows,
int cols,
int initialX,
int initialY,
int xPad,
int yPad)
Aligns the first rows * cols
components of parent in
a grid. |
static void |
setCapsLock(boolean flag)
|
static void |
setLanguage(Locale l)
allows to change the language at runtime (the default locale is used by default) |
static void |
showAboutBox(Component parent)
shows a small antelmann.com about dialog |
static void |
showAboutDialog(Component parent)
shows the standard antelmann.com about dialog with license, version and upgrade button |
static void |
showExceptionDialog(Component parent,
Throwable ex)
|
static void |
showExceptionDialog(Component parent,
Throwable ex,
Thread t)
|
static void |
showExceptionDialog(Throwable ex)
|
static void |
showLicenseDialog(Component parent)
|
static void |
showPropertiesDialog(String title,
Map properties,
Component parent,
boolean modal)
Deprecated. use makePropertiesTable with JOptionPane instead |
static void |
showVersionDialog(Component parent)
|
static void |
showWarning(Component parent,
Exception ex)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ImageIcon antelmannIcon
public static final String aboutString
| Constructor Detail |
|---|
public Menus()
| Method Detail |
|---|
public static ResourceBundle getLanguage(Locale l)
public static ResourceBundle language()
public static void setLanguage(Locale l)
public static void center(Component c)
public static JMenuBar createDefaultMenuBar(Frame parent)
public static JMenu createLookAndFeelMenu(Frame rootComponent)
rootComponent - the top component of the GUI tree that needs to be updatedpublic static JMenuItem createAboutDialogMenuItem(Frame parent)
parent - the component over which the modal dialog is to be placedpublic static JMenuItem createAboutBoxMenuItem(Frame parent)
parent - the component over which the modal dialog is to be placedpublic static void showAboutBox(Component parent)
public static void showAboutDialog(Component parent)
public static void showVersionDialog(Component parent)
public static void showLicenseDialog(Component parent)
@Deprecated
public static void showPropertiesDialog(String title,
Map properties,
Component parent,
boolean modal)
makePropertiesTable with JOptionPane instead
TableUtils.makePropertiesTable(Map, String, String)public static void showExceptionDialog(Throwable ex)
public static void showExceptionDialog(Component parent,
Throwable ex)
public static void showExceptionDialog(Component parent,
Throwable ex,
Thread t)
public static void showWarning(Component parent,
Exception ex)
public static char[] enterPassword(Component parent)
public static char[] enterPassword(Component parent,
String title,
Object message,
String initialValue)
public static char[] enterPassword(Component parent,
String title,
Object message,
String initialValue,
ImageIcon icon)
public static JDialog createDialog(Component parent,
String title,
boolean modal)
JOptionPane.createDialog(Component, String)public static Dialog getDialogForComponent(Component component)
public static void setCapsLock(boolean flag)
throws UnsupportedOperationException
UnsupportedOperationException
public static boolean isCapsLockOn()
throws UnsupportedOperationException
UnsupportedOperationException
public static void makeSpringGrid(Container parent,
int rows,
int cols,
int initialX,
int initialY,
int xPad,
int yPad)
rows * cols
components of parent in
a grid. Each component is as big as the maximum
preferred width and height of the components.
The parent is made just big enough to fit them all.
The parent component must be a SpringLayout.
The code for this method is based on the turorial from the Sun Java website.
rows - number of rowscols - number of columnsinitialX - x location to start the grid atinitialY - y location to start the grid atxPad - x padding between cellsyPad - y padding between cells
public static void makeCompactSpringGrid(Container parent,
int rows,
int cols,
int initialX,
int initialY,
int xPad,
int yPad)
rows * cols
components of parent in
a grid. Each component in a column is as wide as the maximum
preferred width of the components in that column;
height is similarly determined for each row.
The parent is made just big enough to fit them all.
The parent component must be a SpringLayout.
The code for this method is based on the turorial from the Sun Java website.
rows - number of rowscols - number of columnsinitialX - x location to start the grid atinitialY - y location to start the grid atxPad - x padding between cellsyPad - y padding between cells
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||