File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Hi guys !! I really need your help here .. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Hi guys !! I really need your help here .." Watch "Hi guys !! I really need your help here .." New topic
Author

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

Meghna ks
Ranch Hand

Joined: Mar 15, 2001
Posts: 122
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

Joined: Mar 26, 2001
Posts: 3
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hi guys !! I really need your help here ..
 
Similar Threads
Here are the dependencies Madhav .
How to format a textfield to accept different data types?!!
How to format a textfield to accept different data types?!!
A Special TextEdit control for Date
How to format a textfield to accept different data types?!!