Can someone throw some light on how to create Jtable for Master - Detail tables ?. I need to create two JTables one for master records and another for detail records. Whenever I double click on Master record , Detail table should display corressponding detail records . Do I get any example for this anywhere ?. Thanks for your help.
Ariel Hernan Landaida Duarte
Greenhorn
Joined: Nov 21, 2012
Posts: 3
posted
0
hi, i need the master-detail too in swing any idea?
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
add a mouseListener to the table
on double-click populate a tableModel with table1's selection details
set that tableModel as the model for table2
Ariel Hernan Landaida Duarte
Greenhorn
Joined: Nov 21, 2012
Posts: 3
posted
0
can you show a small example please, i don't understand very well, sorry
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
1
if you don't understand the description, example code won't help
I think what you are talking is actually a tree-table and not a table within a table. You can take a look at SwingX which is an open source project and has a component called JXTreeTable.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.