• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 660
  • Last Modified:

Add a JTable inside another JTable's cell

Is there a way to add a jTable complete with headers and data to a cell of a another jTable?
0
ScreenFox
Asked:
ScreenFox
  • 3
  • 2
1 Solution
 
ksivananthCommented:
yes, define another table as table cell renderer.
0
 
ksivananthCommented:
see this example,

http://www.exampledepot.com/egs/javax.swing.table/CustRend.html

instead of extending JLable in the example, you would be extending JTable and handel getTableCellRendererComponent appropriately
0
 
ScreenFoxAuthor Commented:
Thanks, it worked... Is there a way to show the headers too?
0
 
ksivananthCommented:
I can't think of why it won't, can you post your code?
0
 
ScreenFoxAuthor Commented:
Nervermind, it does show the header, but they were empty.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now