This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

basic question.  RSS feed

 
Laszlo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyboody,

How can I include a JPanel into a JTable's cell?
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could make a class that implements the TableCellRenderer interface and either extend JPanel or have a JPanel as a member variable which is returned as the component from the getTableCellRendererComponent method. Then set it for the TableColumn of interest (via TableColumnModel) or use the JTable setDefaultRenderer method.
 
Laszlo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thank you,

I implement it, but I can't growing the panel's size. How can I increase the panel size in the cell? I set the panel's size but not emit any growing at all. Have any idea for this?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!