Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Reg focus events

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
I am in after almost a year.
I have a problem..
I create multiple textfields using a for loop and in that texfield I give some default value.
I want to keep a check that the value set in the textfield shouldnt exceed say 20 it can be anything above default which is say 0.5 and below 20.
How do I do that?
As its an array of textfields... I am getting confused ..
Please help
I hope I will get the same prompt replies as I use to get previously..
Kajol Shroff
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kajol,
I would take the approach to use Document override JTextField and use that to limit the user input. Look at the class below.

Regards,
Manfred.
 
Kajol Shroff
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Manfred,
Thanks for the help.. I could solve the probelm which I was facing about the arrays ..no I have so other problem here....in my program I am not using Swings ... they are just simple applets which have panels in the cardlayout ..
In the panels the first panel is the Personal details ...and in that I have a TextArea where in I need focus because when I give tab to the TextArea it dosent set focus to the next textfield which is below the TextArea
Please get back to me ...on this
[ March 27, 2002: Message edited by: Kajol Shroff ]
 
Evil is afoot. But this tiny ad is just an ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic