• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

jFormattedTextField issue

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 22821
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use a DocumentListener.
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would use a DocumentFilter for this.
 
Seema Sharma
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic