Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable question DefaultTableCellRenderer

 
Scott A Burch
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 105
IntelliJ IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Scott A Burch
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Much obliged.
 
Scott A Burch
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic