|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.text.JTextComponent javax.swing.JTextField javax.swing.JFormattedTextField jwo.utils.gui.JWNumberField
A text field that only allows numeric values to be entered. Since this class implements the TableCellRenderer interface, it can also be used to customise JTable cell output.
Nested Class Summary |
Nested classes inherited from class javax.swing.JFormattedTextField |
JFormattedTextField.AbstractFormatter, JFormattedTextField.AbstractFormatterFactory |
Nested classes inherited from class javax.swing.JTextField |
JTextField.AccessibleJTextField |
Nested classes inherited from class javax.swing.text.JTextComponent |
JTextComponent.AccessibleJTextComponent, JTextComponent.KeyBinding |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class javax.swing.JFormattedTextField |
COMMIT, COMMIT_OR_REVERT, PERSIST, REVERT |
Fields inherited from class javax.swing.JTextField |
notifyAction |
Fields inherited from class javax.swing.text.JTextComponent |
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JWNumberField(NumberFormat numFormat)
Create a formatted text field with the given number format. |
Method Summary | |
static NumberFormat |
createDecimalFormat(int dp)
Creates a decimal formatter that fixes numbers to the given number of decimal places. |
Component |
getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int col)
Allows this formatted field to be used as a customised component in a JTable. |
Methods inherited from class javax.swing.JFormattedTextField |
commitEdit, getActions, getFocusLostBehavior, getFormatter, getFormatterFactory, getUIClassID, getValue, invalidEdit, isEditValid, processFocusEvent, processInputMethodEvent, setDocument, setFocusLostBehavior, setFormatter, setFormatterFactory, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JWNumberField(NumberFormat numFormat)
numFormat
- Number format to use.Method Detail |
public static NumberFormat createDecimalFormat(int dp)
dp
- Number of decimal places.public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col)
getTableCellRendererComponent
in interface TableCellRenderer
table
- Table to display this customised component.value
- Value of table cell to display.isSelected
- True if this component has been selected in table.hasFocus
- True if this component has current focus in table.row
- Row coordinate of table displaying this component.col
- Column coordinate of table displaying this component.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |