Solved

Create sub column in JTable

Posted on 2011-02-20
7
1,123 Views
Last Modified: 2013-11-23
I am using Jtable. I want to set coloumn heading in the format like, if table contains column 'colmn1' then i want 2 sub columns in main coloumn say 'colmn1.1' and 'column1.2'. How should i do it? I am using following code,
private javax.swing.table.DefaultTableModel tm = new javax.swing.table.DefaultTableModel(rows,coloum);
tblsearch.setModel(tm);
0
Comment
Question by:Aurii
  • 4
  • 2
7 Comments
 
LVL 4

Expert Comment

by:aaver
Comment Utility
I'm not sure I understand. Do you want one heading with name "column1" and two sub headings below, named "column1.1" and "column1.2"? In other words, do you want the heading "column1" to span two columns?
0
 
LVL 4

Accepted Solution

by:
aaver earned 500 total points
Comment Utility
0
 

Author Comment

by:Aurii
Comment Utility
I want one heading with name 'column1' and 2 sub headings below, named 'column1.1' and 'column1.2'
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Expert Comment

by:aaver
Comment Utility
Ok, then the second link should be interesting: http://www.codeguru.com/java/articles/124.shtml
0
 
LVL 4

Expert Comment

by:aaver
Comment Utility
The links looked promising at first, but now I'm not so sure any more. I will try to find out a better way.
Sorry for any inconvenience.
0
 

Author Comment

by:Aurii
Comment Utility
These solutions not worked. Please suggest me some useful solution.
0
 
LVL 37

Expert Comment

by:zzynx
Comment Utility
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now