Solved

Create sub column in JTable

Posted on 2011-02-20
7
1,144 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
ID: 34937612
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
ID: 34937620
0
 

Author Comment

by:Aurii
ID: 34940029
I want one heading with name 'column1' and 2 sub headings below, named 'column1.1' and 'column1.2'
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 4

Expert Comment

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

Expert Comment

by:aaver
ID: 34940686
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
ID: 35108157
These solutions not worked. Please suggest me some useful solution.
0
 
LVL 37

Expert Comment

by:zzynx
ID: 35422217
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

792 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