public final class UtilitySwing
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static javax.swing.JButton |
addButton(java.lang.String name,
javax.swing.JPanel panel,
java.awt.event.ActionListener action)
Create a button.
|
static javax.swing.JCheckBox |
addCheckBox(java.lang.String name,
javax.swing.JPanel panel,
java.awt.event.ActionListener action)
Create a check box.
|
static javax.swing.JMenu |
addMenu(javax.swing.JMenuBar bar,
java.lang.String name,
java.lang.String icon)
Create a menu.
|
static <T> javax.swing.JComboBox<T> |
addMenuCombo(java.lang.String name,
javax.swing.JPanel panel,
T[] tab,
ActionCombo actionCombo)
Create a menu combo.
|
static javax.swing.JMenuItem |
addMenuItem(javax.swing.JMenu menu,
java.lang.String name,
java.lang.String ico,
java.awt.event.ActionListener action)
Create a menu item.
|
static javax.swing.JRadioButton |
addRadioButton(java.lang.String name,
javax.swing.JPanel panel,
java.awt.event.ActionListener action)
Create a radio button.
|
static javax.swing.JRadioButton |
addRadioButton(java.lang.String name,
javax.swing.JPanel panel,
java.lang.String tip,
java.awt.event.ActionListener action)
Create a radio button.
|
static javax.swing.JPanel |
createBorderedPanel(java.lang.String title,
int margin)
Create a bordered panel.
|
static javax.swing.JDialog |
createDialog(javax.swing.JFrame owner,
java.lang.String title,
int width,
int height)
Create a dialog.
|
static javax.swing.JTextField |
createField(java.lang.String name,
javax.swing.JPanel panel,
int labelWidth,
int fieldWidth,
int height)
Create a text field.
|
static java.io.File |
createOpenFileChooser(java.lang.String dir,
java.awt.Component parent,
javax.swing.filechooser.FileFilter filter)
Create and open a single file chooser.
|
static void |
setEnabled(java.awt.Component[] components,
boolean enabled)
Set the enabled state of a components set.
|
static void |
startDialog(javax.swing.JDialog dialog)
Start dialog.
|
static void |
terminateDialog(javax.swing.JDialog dialog)
Terminate dialog.
|
public static java.io.File createOpenFileChooser(java.lang.String dir, java.awt.Component parent, javax.swing.filechooser.FileFilter filter)
dir
- The initial directory.parent
- The parent reference.filter
- The file filter to use.null
if not.public static javax.swing.JPanel createBorderedPanel(java.lang.String title, int margin)
title
- The panel title.margin
- The panel margin.public static javax.swing.JButton addButton(java.lang.String name, javax.swing.JPanel panel, java.awt.event.ActionListener action)
name
- The button name.panel
- The button owner.action
- The button action.public static <T> javax.swing.JComboBox<T> addMenuCombo(java.lang.String name, javax.swing.JPanel panel, T[] tab, ActionCombo actionCombo)
T
- The object type.name
- The combo name.panel
- The panel owner.tab
- The combo list.actionCombo
- The combo action.public static javax.swing.JMenu addMenu(javax.swing.JMenuBar bar, java.lang.String name, java.lang.String icon)
bar
- The menu bar owner.name
- The menu name.icon
- The menu icon.public static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu, java.lang.String name, java.lang.String ico, java.awt.event.ActionListener action)
menu
- The menu owner.name
- The item name.ico
- The item icon.action
- The item action.public static javax.swing.JCheckBox addCheckBox(java.lang.String name, javax.swing.JPanel panel, java.awt.event.ActionListener action)
name
- The check box name.panel
- The panel owner.action
- The check box action.public static javax.swing.JRadioButton addRadioButton(java.lang.String name, javax.swing.JPanel panel, java.awt.event.ActionListener action)
name
- The button name.panel
- The panel owner.action
- The button action.public static javax.swing.JRadioButton addRadioButton(java.lang.String name, javax.swing.JPanel panel, java.lang.String tip, java.awt.event.ActionListener action)
name
- The button name.panel
- The panel owner.action
- The button action.tip
- The displayed tip.public static javax.swing.JTextField createField(java.lang.String name, javax.swing.JPanel panel, int labelWidth, int fieldWidth, int height)
name
- The field name.panel
- The panel owner.labelWidth
- The label field width.fieldWidth
- The field width.height
- The global height.public static javax.swing.JDialog createDialog(javax.swing.JFrame owner, java.lang.String title, int width, int height)
owner
- The dialog owner.title
- The dialog title.width
- The dialog width.height
- The dialog height.public static void startDialog(javax.swing.JDialog dialog)
dialog
- The dialog to start.public static void terminateDialog(javax.swing.JDialog dialog)
dialog
- The dialog to terminate.public static void setEnabled(java.awt.Component[] components, boolean enabled)
components
- The components.enabled
- The enabled state.