|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jtheque.utils.ui.SwingUtils
public final class SwingUtils
Provide utility methods for Swing Components.
Method Summary | |
---|---|
static void |
addFieldLengthLimit(JTextField field,
int length)
Limit the length of the field. |
static void |
addFieldValidateAction(JComponent field,
Action action)
Add an action to execute when the validation key (Enter) is pressed. |
static void |
centerFrame(Window frame)
Center a frame on the screen. |
static Component |
createButtonBar(Action... actions)
Create a button bar for actions. |
static Component |
createButtonBar(boolean leftAligned,
Action... actions)
Create a button bar. |
static Font |
getDefaultFont()
Return the default font of the application. |
static JOptionPane |
getOptionPane(Component c)
Return the JOptionPane parent. |
static void |
inEdt(Runnable runnable)
Executed the specified runnable in the EDT. |
static void |
refresh(Component component)
Refresh the specified component. |
static void |
setOptionPaneValue(Component c,
Object value)
Set the option pane value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void centerFrame(Window frame)
frame
- The frame to be centeredpublic static JOptionPane getOptionPane(Component c)
c
- The component.
public static void setOptionPaneValue(Component c, Object value)
c
- The component.value
- The value to set to the JOptionPane.public static Component createButtonBar(Action... actions)
actions
- The actions to create the bar for.
public static Component createButtonBar(boolean leftAligned, Action... actions)
leftAligned
- A boolean flag indicating if we want a left to right alignment or not.actions
- The actions to add to the menu bar.
public static void addFieldValidateAction(JComponent field, Action action)
field
- The field to validate.action
- The action to execute on validate.public static void addFieldLengthLimit(JTextField field, int length)
field
- The field to limit.length
- The maximal length the field may contain.public static Font getDefaultFont()
public static void inEdt(Runnable runnable)
runnable
- The runnable to run in EDT.public static void refresh(Component component)
component
- The component to refresh.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |