public class TimeValidator extends AbstractTextComponentValidator
JTextComponent
. Validates the input
on the fly and gives feedback about whether the time value is valid or not.
Time values can be entered in one of four standard formats defined for the current locale.Constructor and Description |
---|
TimeValidator(javax.swing.text.JTextComponent tc)
Constructs a new
TimeValidator for the given text component. |
Modifier and Type | Method and Description |
---|---|
static TimeValidator |
decorate(javax.swing.text.JTextComponent tc)
Decorates the given text component.
|
java.lang.String |
getStandardTooltipText()
Returns the standard tooltip text.
|
java.lang.String |
getStandardTooltipTextAsHtml()
Returns the standard tooltip text as HTML.
|
java.time.LocalTime |
getTime()
Returns the time.
|
boolean |
isValid()
Replies true if the current content of the decorated text component is valid;
false otherwise
|
void |
validate()
Implement in subclasses to validate the content of the text component.
|
actionPerformed, changedUpdate, feedbackDisabled, feedbackInvalid, feedbackValid, focusGained, focusLost, getComponent, insertUpdate, propertyChange, removeUpdate
public TimeValidator(javax.swing.text.JTextComponent tc)
TimeValidator
for the given text component.tc
- text componentpublic static TimeValidator decorate(javax.swing.text.JTextComponent tc)
tc
- text component to decoratetc
public boolean isValid()
AbstractTextComponentValidator
isValid
in class AbstractTextComponentValidator
public java.lang.String getStandardTooltipTextAsHtml()
public java.lang.String getStandardTooltipText()
public void validate()
AbstractTextComponentValidator
validate
in class AbstractTextComponentValidator
public java.time.LocalTime getTime()