This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript 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?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!