aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How to set the data type of an IPAddress & Date/Time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to set the data type of an IPAddress & Date/Time" Watch "How to set the data type of an IPAddress & Date/Time" New topic
Author

How to set the data type of an IPAddress & Date/Time

Meghna ks
Ranch Hand

Joined: Mar 15, 2001
Posts: 122
Hi
I have a JTable with 2 columns, there are other attributes of the JTable which are hidden from the user. Now,the second column values depend on all these other attribute values. For eg, one of them is a boolean, the other is a IPAddress value and the third a Date/ Time value. Depending on these values passed, the second column should be able to set its data.
Now what I need to know is :
1. I need to set up a combobox in the second column for the date/time attributes. How do I go about to do this ?!!
2. How do I manipulate the TextField of the JTable such that it can accept the format of an IP address ?!!
Your help and suggestions are greatly appreciated !!
Thanks
Meghna
Angela Lamb
Ranch Hand

Joined: Feb 22, 2001
Posts: 156
It sounds like you'll need to create custom cell renderers. The Swing tutorial from Sun covers this topic:

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#editrender
Meghna ks
Ranch Hand

Joined: Mar 15, 2001
Posts: 122
Hi Angela
Thanks a lot for the help. I'd referred to it before and I did pick up some hints. But they specify that a renderer can be defined for a particular column of the same data type/component but do not explain what if a single column should be able to accomodate a boolen or an Integer type or a combobox or a String/Date data types. I'd really appreciate it if you could throw some light on these points.
Thanks again
Meghna
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set the data type of an IPAddress & Date/Time