APIdia Launch Partner
Top Fields Constructors Methods
javax.swing.colorchooser

pack-priv final Class ValueFormatter

extends AbstractFormatter
implements FocusListener, Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable, java.awt.event.FocusListener, java.util.EventListener
Annotations
@SuppressWarnings:serial
Imports
java.awt.event.FocusEvent, .FocusListener, java.text.ParseException, javax.swing.JFormattedTextField, .JFormattedTextField.AbstractFormatter, .SwingConstants, .SwingUtilities, javax.swing.text.AttributeSet, .BadLocationException, .DefaultFormatterFactory, .DocumentFilter

Field Summary

Modifier and TypeField and Description
private final DocumentFilter
private final int
private final int
private JFormattedTextField

Constructor Summary

AccessConstructor and Description
pack-priv
ValueFormatter(int length, boolean hex)

Method Summary

Modifier and TypeMethod and Description
public void
focusGained(FocusEvent event)

Implements java.awt.event.FocusListener.focusGained.

Invoked when a component gains the keyboard focus.

public void
focusLost(FocusEvent event)

Implements java.awt.event.FocusListener.focusLost.

Invoked when a component loses the keyboard focus.

protected DocumentFilter
getDocumentFilter()

Overrides javax.swing.JFormattedTextField.AbstractFormatter.getDocumentFilter.

Subclass and override if you wish to provide a DocumentFilter to restrict what can be input.

pack-priv static void
init(int length, boolean hex, JFormattedTextField text)

private boolean
isValid(int length)

private boolean
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

public Object
stringToValue(String text)

Implements abstract javax.swing.JFormattedTextField.AbstractFormatter.stringToValue.

Parses text returning an arbitrary Object.

public String
valueToString(Object object)

Implements abstract javax.swing.JFormattedTextField.AbstractFormatter.valueToString.

Returns the string value to display for value.

Inherited from javax.swing.JFormattedTextField.AbstractFormatter:
clonegetActionsgetFormattedTextFieldgetNavigationFilterinstallinvalidEditsetEditValiduninstall

Field Detail

filterback to summary
private final DocumentFilter filter
lengthback to summary
private final int length
radixback to summary
private final int radix
textback to summary
private JFormattedTextField text

Constructor Detail

ValueFormatterback to summary
pack-priv ValueFormatter(int length, boolean hex)

Method Detail

focusGainedback to summary
public void focusGained(FocusEvent event)

Implements java.awt.event.FocusListener.focusGained.

Doc from java.awt.event.FocusListener.focusGained.

Invoked when a component gains the keyboard focus.

focusLostback to summary
public void focusLost(FocusEvent event)

Implements java.awt.event.FocusListener.focusLost.

Doc from java.awt.event.FocusListener.focusLost.

Invoked when a component loses the keyboard focus.

getDocumentFilterback to summary
protected DocumentFilter getDocumentFilter()

Overrides javax.swing.JFormattedTextField.AbstractFormatter.getDocumentFilter.

Doc from javax.swing.JFormattedTextField.AbstractFormatter.getDocumentFilter.

Subclass and override if you wish to provide a DocumentFilter to restrict what can be input. install will install the returned value onto the JFormattedTextField.

Annotations
@Override
initback to summary
pack-priv static void init(int length, boolean hex, JFormattedTextField text)
isValidback to summary
private boolean isValid(int length)
isValidback to summary
private boolean isValid(String text)
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

stringToValueback to summary
public Object stringToValue(String text) throws ParseException

Implements abstract javax.swing.JFormattedTextField.AbstractFormatter.stringToValue.

Doc from javax.swing.JFormattedTextField.AbstractFormatter.stringToValue.

Parses text returning an arbitrary Object. Some formatters may return null.

Annotations
@Override
Exceptions
ParseException:
if there is an error in the conversion
valueToStringback to summary
public String valueToString(Object object) throws ParseException

Implements abstract javax.swing.JFormattedTextField.AbstractFormatter.valueToString.

Doc from javax.swing.JFormattedTextField.AbstractFormatter.valueToString.

Returns the string value to display for value.

Annotations
@Override
Exceptions
ParseException:
if there is an error in the conversion