|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.cisban.rod.gui.UtilityMethods
public class UtilityMethods
Contains a series of static methods intended to simplify coding interfaces in Java Swing.
Constructor Summary | |
---|---|
UtilityMethods()
|
Method Summary | |
---|---|
static void |
addSeparator(javax.swing.JPanel panel,
int separatorType,
int size)
Adds a separator of the given separatorType (one of SwingConstants.VERTICAL or SwingConstants.HORIZONTAL) with buffering around it. |
static javax.swing.table.DefaultTableModel |
clearTableModel(javax.swing.table.DefaultTableModel model)
|
static javax.swing.JComponent |
constrainJComponentSize(javax.swing.JComponent txtfld)
|
static javax.swing.JLabel |
createLabel(java.lang.String text)
Creates a label |
static javax.swing.JLabel |
createLabel(java.lang.String text,
int width)
Creates a label and sets it to a specific size so that they line up nicely in the GUI |
static javax.swing.JTextField |
createTextField(java.lang.String text,
int width)
|
static javax.swing.JPanel |
getNewPanel(int boxOrientation)
|
static javax.swing.text.JTextComponent |
initializeTextComponent(javax.swing.text.JTextComponent comp)
|
static void |
setEnabled(java.awt.Component j,
boolean enabled)
|
static int |
showFileChooser(javax.swing.JFileChooser fileChooser,
int chooserType,
java.awt.Component c)
Opens a save or open JFileChooser and saves the position where it was opened. |
static int |
showFolderChooser(javax.swing.JFileChooser fileChooser,
java.awt.Component c)
|
static int |
showOptionDialog(java.lang.String title,
java.lang.Object message)
|
static int |
showResizeableDialog(java.lang.String title,
javax.swing.JComponent message)
|
static void |
turnColor(java.awt.Component component)
|
static void |
turnColors(java.awt.Component[] components,
java.awt.Color color)
|
static void |
validateDateComponent(java.text.SimpleDateFormat format,
javax.swing.text.JTextComponent component)
|
static void |
validateJTextComponent(javax.swing.text.JTextComponent component)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UtilityMethods()
Method Detail |
---|
public static javax.swing.JLabel createLabel(java.lang.String text, int width)
text
- the text to includewidth
- the width of the label
public static void addSeparator(javax.swing.JPanel panel, int separatorType, int size)
public static javax.swing.JLabel createLabel(java.lang.String text)
text
- the text to includewidth
- the width of the label
public static javax.swing.JTextField createTextField(java.lang.String text, int width)
public static javax.swing.text.JTextComponent initializeTextComponent(javax.swing.text.JTextComponent comp)
public static javax.swing.JComponent constrainJComponentSize(javax.swing.JComponent txtfld)
public static int showOptionDialog(java.lang.String title, java.lang.Object message)
public static int showResizeableDialog(java.lang.String title, javax.swing.JComponent message)
public static javax.swing.table.DefaultTableModel clearTableModel(javax.swing.table.DefaultTableModel model)
public static int showFileChooser(javax.swing.JFileChooser fileChooser, int chooserType, java.awt.Component c)
fileChooser
- a JFileChooserchooserType
- the type of chooser, eg. JFileChooser.OPEN_DIALOG or JFileChooser.SAVE_DIALOGc
- the parent component
public static int showFolderChooser(javax.swing.JFileChooser fileChooser, java.awt.Component c)
public static void setEnabled(java.awt.Component j, boolean enabled)
public static void validateJTextComponent(javax.swing.text.JTextComponent component) throws IncorrectInputException
IncorrectInputException
public static void validateDateComponent(java.text.SimpleDateFormat format, javax.swing.text.JTextComponent component) throws IncorrectInputException
IncorrectInputException
public static void turnColors(java.awt.Component[] components, java.awt.Color color)
public static javax.swing.JPanel getNewPanel(int boxOrientation)
public static void turnColor(java.awt.Component component)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |