public abstract class FormUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static Icon |
CANCEL_ICON |
static Icon |
OK_ICON |
| Constructor and Description |
|---|
FormUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Border |
createEmptyBorder(int size)
Creates empty border
|
static Border |
createTitledBorder(String name)
Create Titled Border
|
static List<Object> |
getComboModelList(ComboBoxModel<?> model)
Return a List of Objects from a ComboBoxModel
|
static Icon |
getIcon(Icon icon,
String url)
Load icon if icon = null, else return icon.
|
static Icon |
getIcon(String url)
Load Icon from url
|
static void |
link(JComboBox<?> primary,
JComboBox<?> dependent,
String propertyName) |
static void |
link(JComboBox primary,
JComboBox dependent,
String propertyName,
boolean addNull)
Add a link on primary and dependent JComboBoxes by property name.
|
static JButton |
newCancelButton()
Get Default Cancel Button from LookAndFeel (like JOptionPane)
|
static <T> JComboBox<T> |
newCombo(Class<T> clazz,
int chars) |
static JComboBox<?> |
newCombo(int chars) |
static JDialog |
newDialog(Component component)
Creates a new JDialog with default accept/cancel buttons
|
static JDialog |
newDialog(Window owner,
Component component)
Creates a new JDialog with default accept/cancel buttons
|
static JLabel |
newLabelForBox(String message) |
static JButton |
newOKButton()
Get Default OK Button from LookAndFeel (like JOptionPane)
|
static void |
setBold(JLabel label)
Make font of JLabel bold
|
static void |
showError(Component parent,
String message)
Show error message
|
static void |
showError(String message)
Show error message
|
static JMenu |
toMenu(List<Action> actions)
Make a JMenu from an Action List
|
public static final Icon CANCEL_ICON
public static final Icon OK_ICON
public static void link(JComboBox primary, JComboBox dependent, String propertyName, boolean addNull)
primary - JComboBox when selection changesdependent - JComboBox that are filled with collectionpropertyName - the property name for get the collection from primary selected itemaddNull - if true, add a null as first combobox itempublic static List<Object> getComboModelList(ComboBoxModel<?> model)
model - ComboBoxModelpublic static JComboBox<?> newCombo(int chars)
public static void setBold(JLabel label)
label - JLabel to make boldpublic static Border createTitledBorder(String name)
name - the titlepublic static JButton newOKButton()
public static JButton newCancelButton()
public static Icon getIcon(String url)
url - public static Icon getIcon(Icon icon, String url)
icon - icon to loadurl - String with urlpublic static JMenu toMenu(List<Action> actions)
actions - the Action Listpublic static JLabel newLabelForBox(String message)
message - public static void showError(String message)
message - message to showpublic static void showError(Component parent, String message)
parent - component parentmessage - message to showpublic static JDialog newDialog(Component component)
component - to show inpublic static JDialog newDialog(Window owner, Component component)
owner - owner windowcomponent - component to show inpublic static Border createEmptyBorder(int size)
size - border sizeCopyright © 2014 JDAL. All Rights Reserved.