gravsphcolldemo
Class ColorInputVerifier
java.lang.Object
|
+--javax.swing.InputVerifier
|
+--gravsphcolldemo.ColorInputVerifier
- public class ColorInputVerifier
- extends javax.swing.InputVerifier
This is an input-verifier for JTextField's containing a colorname or a color-Vector3D with
components in the range 0-1.
- Version:
- 19-Apr-2001
- Author:
- Miklos Reiter
Method Summary |
boolean |
getAcceptEmpty()
Is the empty string accepted as a valid entry? |
void |
setAcceptEmpty(boolean emptyEntryAccepted)
Sets whether the empty string should be accepted as valid. |
boolean |
shouldYieldFocus(javax.swing.JComponent input)
Displays a message box complaining to the user and informing them
briefly of the format of a Color, if the input is invalid, in
addition to calling the inherited method. |
boolean |
verify(javax.swing.JComponent input)
Returns true if the JTextField input contains a valid Color. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ColorInputVerifier
public ColorInputVerifier()
- Constructs a new ColorInputVerifier object.
This verifier will accept the empty string as a valid entry.
ColorInputVerifier
public ColorInputVerifier(boolean emptyEntryAccepted)
- Constructs a new ColorInputVerifier object.
getAcceptEmpty
public boolean getAcceptEmpty()
- Is the empty string accepted as a valid entry?
setAcceptEmpty
public void setAcceptEmpty(boolean emptyEntryAccepted)
- Sets whether the empty string should be accepted as valid.
shouldYieldFocus
public boolean shouldYieldFocus(javax.swing.JComponent input)
- Displays a message box complaining to the user and informing them
briefly of the format of a Color, if the input is invalid, in
addition to calling the inherited method.
- Overrides:
shouldYieldFocus
in class javax.swing.InputVerifier
verify
public boolean verify(javax.swing.JComponent input)
- Returns true if the JTextField input contains a valid Color.
- Overrides:
verify
in class javax.swing.InputVerifier