|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.jidesoft.swing.LabeledTextField
com.jidesoft.field.creditcard.CreditCardTextField
public class CreditCardTextField
CreditCardTextField is a LabeledTextField which can accept and verify credit card numbers.
After user enters the number, it has method to verify if the number is a valid credit card number. If validated, what
type of credit card it is and then display an icon for the credit card type next to it.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.jidesoft.swing.LabeledTextField |
|---|
LabeledTextField.PopupMenuCustomizer |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
PROPERTY_MASK_ENABLED
|
static String |
PROPERTY_VALIDATE_ON_FLY
|
| Fields inherited from class com.jidesoft.swing.LabeledTextField |
|---|
_button, _contextMenuKeyStroke, _customizer, _hintLabel, _hintText, _icon, _label, _labelText, _showHintTextWhenFocused, _textField |
| 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 java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
CreditCardTextField()
|
|
CreditCardTextField(Icon icon)
|
|
CreditCardTextField(Icon icon,
String labelText)
|
|
| Method Summary | |
|---|---|
protected JTextField |
createTextField()
Creates the text field. |
String[] |
getAllowedCardIssuerNames()
Gets allowed credit card issuers' name in an array. |
CardIssuer |
getCardIssuer()
Get issuer of the card number if valid. |
Icon |
getCreditCardIcon()
Get the icon which is displayed when there is no input number. |
CreditCardMask |
getCreditCardMask()
Gets the credit card mask. |
String |
getCreditCardNumber()
Get the credit card number |
Icon |
getInvalidCreditCardIcon()
Gets the icon which is displayed when the input number is invalid. |
boolean |
isMaskEnabled()
Checks if the mask feature is enabled. |
boolean |
isValidateOnFly()
Checks if we will validate the credit card number on fly. |
void |
maskCardNumber()
Masks the card number so that the actual number is not displayed. |
void |
setAllowedCardIssuerNames(String[] allowedCardIssuerNames)
Set the allowed credit card issuer names. |
void |
setCreditCardIcon(Icon icon)
Sets the icon which is displayed when the input number is invalid. |
void |
setCreditCardMask(CreditCardMask mask)
Sets CreditCardMask. |
void |
setInvalidCreditCardIcon(Icon icon)
set the icon which is displayed when the input number is invalid. |
void |
setMaskEnabled(boolean enabled)
Enables/disables the mask feature. |
void |
setValidateOnFly(boolean validateOnFly)
Enables/disables the validate on fly feature |
void |
unmaskCardNumber()
Displays the actual card number. |
boolean |
validateCardNumber()
Checks if the input number is a valid credit card number. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PROPERTY_VALIDATE_ON_FLY
public static final String PROPERTY_MASK_ENABLED
| Constructor Detail |
|---|
public CreditCardTextField()
public CreditCardTextField(Icon icon)
public CreditCardTextField(Icon icon,
String labelText)
| Method Detail |
|---|
protected JTextField createTextField()
createTextField in class LabeledTextFieldpublic void setAllowedCardIssuerNames(String[] allowedCardIssuerNames)
allowedCardIssuerNames - the allowed credit card issuers namespublic String[] getAllowedCardIssuerNames()
public String getCreditCardNumber()
public CardIssuer getCardIssuer()
validateCardNumber() first.
public CreditCardMask getCreditCardMask()
public void setCreditCardMask(CreditCardMask mask)
mask - a new CreditCardMaskpublic void setMaskEnabled(boolean enabled)
enabled - true to enable the mask feature and false to disable it.public boolean isMaskEnabled()
public boolean isValidateOnFly()
public void setValidateOnFly(boolean validateOnFly)
validateOnFly - true or false.public Icon getCreditCardIcon()
public void setCreditCardIcon(Icon icon)
icon - a new icon which will be displayed when there is no input number.public Icon getInvalidCreditCardIcon()
public void setInvalidCreditCardIcon(Icon icon)
icon - the icon which is displayed when the input number is invalid.public boolean validateCardNumber()
public void unmaskCardNumber()
public void maskCardNumber()
|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||