public class GuiUtilities extends Object
Constructor and Description |
---|
GuiUtilities() |
Modifier and Type | Method and Description |
---|---|
static int |
getPreferredWidthOfCell(JTable table,
int rowIndex,
int colIndex)
Returns the preferred width of a given cell in a table.
|
static void |
installEscapeCloseOperation(JDialog dialog)
Close a dialog using the escape key.
|
static boolean |
validateDoubleInput(Component parentComponent,
JLabel label,
JTextField textField,
String valueDescription,
String errorTitle,
boolean positiveValue,
boolean showMessage,
boolean valid)
Validate double input.
|
static boolean |
validateIntegerInput(Component parentComponent,
JLabel label,
JTextField textField,
String valueDescription,
String errorTitle,
boolean positiveValue,
boolean showMessage,
boolean valid)
Validate integer input.
|
public static int getPreferredWidthOfCell(JTable table, int rowIndex, int colIndex)
table
- the tablecolIndex
- the colum indexrowIndex
- the row indexpublic static boolean validateIntegerInput(Component parentComponent, JLabel label, JTextField textField, String valueDescription, String errorTitle, boolean positiveValue, boolean showMessage, boolean valid)
parentComponent
- the parent componentlabel
- the label of the inputtextField
- the text field containing the inputvalueDescription
- the description of the inputerrorTitle
- the error titlepositiveValue
- if true, only positive values will pass the filtershowMessage
- if true, a message will be shown if the validation
failsvalid
- the status of previous validationspublic static boolean validateDoubleInput(Component parentComponent, JLabel label, JTextField textField, String valueDescription, String errorTitle, boolean positiveValue, boolean showMessage, boolean valid)
parentComponent
- the parent componentlabel
- the label of the inputtextField
- the text field containing the inputvalueDescription
- the description of the inputerrorTitle
- the error titlepositiveValue
- if true, only positive values will pass the filtershowMessage
- if true, a message will be shown if the validation
failsvalid
- the status of previous validationspublic static void installEscapeCloseOperation(JDialog dialog)
dialog
- the dialog to install the escape close onCopyright © 2016. All rights reserved.