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 JComboBox |
addMenuCombo(String name,
JPanel panel,
Object[] tab,
ActionCombo actionCombo)
Create a menu combo.
|
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 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 JComboBox addMenuCombo(String name, JPanel panel, Object[] tab, ActionCombo actionCombo)
name
- The combo name.panel
- The panel owner.tab
- The combo list.actionCombo
- The combo 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 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 © 2016 Byron 3D Games Studio. All rights reserved.