Learning The "J"

Home » JAVA Learning » SWINGS » Input Text Validation

Category Archives: Input Text Validation

Input Text Validation in JTextBox

To validate the JTextFieldinput ,its easy to use “setDocument” method of JTextField. For this you have to create your validation class which extends javax.swing.text.Plaindocument and write your validation code inside it. then add it as, JTextField.setDocument(userdefinedclass). Its much more flexible then using lostfocus and other events.
(more…)

Advertisements