public final class UtilitySwing extends Object
Modifier and Type | Method and Description |
---|---|
static JButton |
addButton(String name,
JPanel panel,
ActionListener action)
Create a button.
|
static JCheckBox |
addCheckBox(String name,
JPanel panel,
ActionListener action)
Create a check box.
|
static JMenu |
addMenu(JMenuBar bar,
String name,
String icon)
Create a menu.
|
static <T> JComboBox<T> |
addMenuCombo(String name,
JPanel panel,
T[] tab,
ActionCombo actionCombo)
Create a menu combo.
|
static JMenuItem |
addMenuItem(JMenu menu,
String name,
String ico,
ActionListener action)
Create a menu item.
|
static JRadioButton |
addRadioButton(String name,
JPanel panel,
ActionListener action)
Create a radio button.
|
static JRadioButton |
addRadioButton(String name,
JPanel panel,
String tip,
ActionListener action)
Create a radio button.
|
static JPanel |
createBorderedPanel(String title,
int margin)
Create a bordered panel.
|
static JDialog |
createDialog(JFrame owner,
String title,
int width,
int height)
Create a dialog.
|
static JTextField |
createField(String name,
JPanel panel,
int labelWidth,
int fieldWidth,
int height)
Create a text field.
|
static File |
createOpenDirectoryChooser(String title,
String dir,
Component parent,
FileFilter filter)
Create and open a single directory chooser.
|
static File |
createOpenFileChooser(String title,
String dir,
Component parent,
FileFilter filter)
Create and open a single file chooser.
|
static void |
setBorderedPanel(JPanel panel,
String title,
int margin)
Set a bordered panel.
|
static void |
setEnabled(Component[] components,
boolean enabled)
Set the enabled state of a components set.
|
static void |
startDialog(JDialog dialog)
Start dialog.
|
static void |
terminateDialog(JDialog dialog)
Terminate dialog.
|
public static File createOpenFileChooser(String title, String dir, Component parent, FileFilter filter)
title
- The dialog title.dir
- The initial directory.parent
- The parent reference.filter
- The file filter to use.null
if not.public static File createOpenDirectoryChooser(String title, String dir, Component parent, FileFilter filter)
title
- The dialog title.dir
- The initial directory.parent
- The parent reference.filter
- The file filter to use.null
if not.public static JPanel createBorderedPanel(String title, int margin)
title
- The panel title.margin
- The panel margin.public static void setBorderedPanel(JPanel panel, String title, int margin)
panel
- The panel reference.title
- The panel title.margin
- The panel margin.public static JButton addButton(String name, JPanel panel, ActionListener action)
name
- The button name.panel
- The button owner.action
- The button action.public static <T> JComboBox<T> addMenuCombo(String name, 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 JMenu addMenu(JMenuBar bar, String name, String icon)
bar
- The menu bar owner.name
- The menu name.icon
- The menu icon.public static JMenuItem addMenuItem(JMenu menu, String name, String ico, ActionListener action)
menu
- The menu owner.name
- The item name.ico
- The item icon.action
- The item action.public static JCheckBox addCheckBox(String name, JPanel panel, ActionListener action)
name
- The check box name.panel
- The panel owner.action
- The check box action.public static JRadioButton addRadioButton(String name, JPanel panel, ActionListener action)
name
- The button name.panel
- The panel owner.action
- The button action.public static JRadioButton addRadioButton(String name, JPanel panel, String tip, ActionListener action)
name
- The button name.panel
- The panel owner.action
- The button action.tip
- The displayed tip.public static JTextField createField(String name, 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 JDialog createDialog(JFrame owner, 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(JDialog dialog)
dialog
- The dialog to start.public static void terminateDialog(JDialog dialog)
dialog
- The dialog to terminate.public static void setEnabled(Component[] components, boolean enabled)
components
- The components.enabled
- The enabled state.Copyright © 2014 Byron 3D Games Studio. All rights reserved.