Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi guys !! I really need your help here ..

 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi people
I have a bean with Labels and textfields together. The data inside the textfields is a Vector of Objects. I need to be able to get the textfield to accept different datatypes depending on other dependencies like :
The value in the textfield depends on the value of another attribute called syntax which is of type string. For eg.
if syntax => "Integer" then textfield =>accepts only integers
if syntax => "String" then textfield => acceps only strings
if syntax => "Date" then textfield should be formatted with a combobox to set up a calender and select the date
How do I get the textfield to accept :
1. A String datatype only
2. An Integer datatype only
3. A Date datat type only
4. An IPAddress formatted value
Thanks
Meghna
 
prasadsvja
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to implement PlainDocumentModel on your JTextField.
May be you can have a overloaded constructors for your text field with datatypes you are expecting as parameters.Hope this is clear to you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic