Split a cell into two in a JTable
843806Jul 18 2009 — edited Jul 18 2009Hi,
I am trying to do the following:
At the moment my table looks like this
Heading 1 | Heading 2
Text.........| Text
Text.........| Text
However, I would like to do the following:
Heading 1 | Heading 2
Text | Text | Text | Text
Text | Text | Text | Text
My code at the moment is this:
mytable = new javax.swing.JTable();
mytable.setModel(myModel);
mytable.getTableHeader().setReorderingAllowed(false);
jScrollPane1.setViewportView(mytable);
What do I need to do to get the outcome I'm trying to achieve?
I have seen several examples on the web when searching google but I don't really understand them. I have also tried several of them but they didn't work for me.
I am not asking for someone to do it all for me but could someone give a very detailed example with explanations to each part and maybe sample code?
Thanks
Edited by: surfi2000 on Jul 18, 2009 2:38 PM