jQuery in Action, 2nd edition*
The moose likes Swing / AWT / SWT and the fly likes jFormattedTextField issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jFormattedTextField issue" Watch "jFormattedTextField issue" New topic
Author

jFormattedTextField issue

Seema Sharma
Ranch Hand

Joined: May 24, 2007
Posts: 78
Hi,
The problem is to avoid the duplicate text of 1st jformattedtextfield to be entered in 2nd jformattedtextfield. i need to display meesage if two textfields has same text.

I am able to provide the message only when focus lost event takes places. I want to display the message as soon the duplicate text is entered in jformattedtextfield. Please help me to proceed.


.

Thanks in advance,
Seema
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19653
    
  18

Use a DocumentListener.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
I would use a DocumentFilter for this.
Seema Sharma
Ranch Hand

Joined: May 24, 2007
Posts: 78
Thanks. I have used DocumentFilter and it works.

Now my scenario is when i do data validation, navigation to other screens should not be allowed unless valid input is entered in these textfields.

My window has Jtabbedpane which has 3 tabs. Above mentioned Jformattedtextfields is available in one of the tabs. If these textfields has: Duplicate value, empty or invalid data, validation is done and message is displayed.

If one of the text field has duplicate value/empty/invalid data and cursor is still available in the textfield and one of the tab panel is selected, then the validation message is displayed on that tabbed panel.

I need to restrict navigation and display this validation message on the panel where these textfields are available.

Please help me to resolve this issue.


Regards,
Seema

 
Don't get me started about those stupid light bulbs.
 
subject: jFormattedTextField issue
 
Similar Threads
(GWT) Forcing SuggestBox to display its values
Simple: Turning A Program Into An Applet
jquery.validate and tabber.js problems validating
getting batchupdate exception while inserting recored for second time...
JOptionPane dialog box is not displaying