Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / September 2007

Tip: Looking for answers? Try searching our database.

JTable - Merging cells

Thread view: 
Chanchal - 20 Sep 2007 11:51 GMT
Hi All,

 Is ther anyway cells can be merged row-wise in JTable? Any sample
code available?

Thanks in advance

Chanchal
Roedy Green - 25 Sep 2007 08:35 GMT
On Thu, 20 Sep 2007 03:51:27 -0700, Chanchal
<chanchal.jacob@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>  Is ther anyway cells can be merged row-wise in JTable? Any sample
>code available?

What do you mean by merged?  

Do you mean for example to add two rows together, putting the result
in the first row, then delete the second?

If so, just do the merge in your model is a the ordinary way, then
fire the appropriate change events to notify JTable to repaint.

TableModel is the part you write to manage the data. When data change,
the TableModel fires events to let the GUI know to refresh portions of
the table. You do this with AbstractTableModel.fireTableCellUpdated,
fireTableRowsUpdated, fireTableRowsDeleted, fireTableDataChanged or
fireTableStructureChanged. Use the most specific method, e.g.
fireTableCellUpdated in preference to fireTableRowsUpdated if you just
updated a few cells. Data are organised in rows and columns. Cells can
contain nulls which will paint happily as blank.

For more detail see http://mindprod.com/jgloss/jtable.html
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.