This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!

Youssef Ayyar

Greenhorn
+ Follow
since Nov 17, 2018
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Youssef Ayyar


Hi Developers,

I want to make table in Java with two rows in header, like this:

|-------------------------------------------------|
|                       |              Title 2                |
|       Title 1       |------------------------------|
|                       |      Title 3     |     Tilte 4    |
|------------------|------------------------------|

For this reason I have proceed with this code in Netbeans-Java:

public table()
{
   String[][] tableHeader = new String[][] {
           new String[] {"Title1", ""},
           new String[] {"Title2", "Title3"},
           new String[] {"Title2", "Title4"}
       };
   
    DefaultTableModel model = new javax.swing.table.DefaultTableModel(new Object [][]{}, tableHeader);
       
    jTable1.setModel(model);
}

But I don't have good result.

Please help me.


3 weeks ago