| | |
Merging And Splitting
![]() |
•
•
Join Date: Jun 2004
Posts: 609
Reputation:
Solved Threads: 7
Hi everyone,
I have a jtable and i need a way to be able to merge or to split the cells(both the rows and columns) selected by the user. I have seen the table model and jtable apis' and there seems to be nothing about this. I would appreciate it if someone could show me any codings or any link to any web page on how the splitting and merging of jtable cells whether it is a column or row.
Thank You
Yours Sincerely
Richard West
I have a jtable and i need a way to be able to merge or to split the cells(both the rows and columns) selected by the user. I have seen the table model and jtable apis' and there seems to be nothing about this. I would appreciate it if someone could show me any codings or any link to any web page on how the splitting and merging of jtable cells whether it is a column or row.
Thank You
Yours Sincerely
Richard West
•
•
Join Date: Jun 2004
Posts: 609
Reputation:
Solved Threads: 7
•
•
•
•
Originally Posted by jwenting
You'd have to replace the TableModel with a different one I think.
Or maybe just changing the underlying datastructures holding the header and row information on the fly and notifying the table would do the trick.
How would i go about doing that?
If possible could you explain in detail
Richard West
My experience with Swing is rather limited and mainly theoretical.
I'm only now really starting to read up on it in preparation for the SCJD certification I'm planning to work towards over the next half year or so.
I guess you have a class derived from AbstractTableModel which you use to display your data?
You would have to make another class derived from AbstractTableModel which displays the same data in a different way.
That would enable you to combine the display of several columns into one.
To merge rows together you'd do something similar I guess.
You may need to explicitly tell the application to redraw the JTable, you'd need to try that.
I'm only now really starting to read up on it in preparation for the SCJD certification I'm planning to work towards over the next half year or so.
I guess you have a class derived from AbstractTableModel which you use to display your data?
You would have to make another class derived from AbstractTableModel which displays the same data in a different way.
That would enable you to combine the display of several columns into one.
To merge rows together you'd do something similar I guess.
You may need to explicitly tell the application to redraw the JTable, you'd need to try that.
![]() |
Similar Threads
- Dreamweaver CS3 table layout issue in Internet Exploerer. (Site Layout and Usability)
- New Daniweb!!! (DaniWeb Community Feedback)
- Splitting Files ., Making them fit to a CD (Windows NT / 2000 / XP)
Other Threads in the Java Forum
- Previous Thread: Java Help!!!
- Next Thread: Looking for Web proxy in Java
| Thread Tools | Search this Thread |
6 @param actuate android api applet application arc array arrays automation balls binary bluetooth bold business byte c++ chat class client code codesnippet collections compare component coordinates database defaultmethod detection doctype dragging ebook eclipse educational error file fractal froglogic game givemetehcodez graphics gui guitesting helpwithhomework hql html ide ideas image ingres input integer internet intersect invokingapacheantprogrammatically j2me java javaexcel javaprojects jni jpanel jtextarea julia linux list map method methods mobile mysql netbeans newbie nextline parameter php pong problem program programming project recursion recursive scanner sell server set sms sort sql string sun swing swt terminal threads tree web websites windows






