aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable question DefaultTableCellRenderer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable question DefaultTableCellRenderer" Watch "JTable question DefaultTableCellRenderer" New topic
Author

JTable question DefaultTableCellRenderer

Scott A Burch
Ranch Hand

Joined: Jan 04, 2011
Posts: 50
I am trying to create a JTable with 5 columns of the following types: the first is a string; the second is a date that displays month, day, year; the third and fourth are also date but display hours, minutes, seconds; the fifth is boolean, true or false. I need a cell renderer of some kind to specify this variety but I cannot find any good examples of how to accomplish this. Can someone point out a good example somewhere? I have been reading the "How to use Tables" guide, specifically the part about customer renderers, and googling published code, but I haven't seen any examples of JTables with columns of varying types.

All the fields are editable and no data will be defined at initialization -- a user will input everything. I have a prototype so far on NetBeans but I cannot so far specify the column types.

thanks!
Wayan Saryada
Ranch Hand

Joined: Feb 05, 2004
Posts: 105

You could start from the Official Java Tutorials home page. And here is a link that point to how to use tables: How to Use Tables.


Website: Learn Java by Examples
Scott A Burch
Ranch Hand

Joined: Jan 04, 2011
Posts: 50
Much obliged.
Scott A Burch
Ranch Hand

Joined: Jan 04, 2011
Posts: 50
The website mentioned in the footnote - Learn Java Programming by Examples - had an example I was looking for ... this will let me create the date object. I'll figure out the rest. Thanks!

 
 
subject: JTable question DefaultTableCellRenderer