• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Adding columns inside another column in JTable

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have created my own TableModel and it is working fine. I have 4 columns already in it. I want to add 3 sub columns inside the column number 3 and 4. I went through an article in which i can insert a column in the table but couldn find any help in inserting sub columns. Can anyone please help me. The column name is "Heap Memory" and the three sub columns that i want to add in this column are "Used","Commited" and "Maximum".
Any help would be appreciated..

Thanks
Pooja
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sounds like you want a multi width header (see the pic at the top of the link)

http://www.java2s.com/Code/Java/Swing-Components/MultiWidthHeaderExample.htm
 
Pooja Patole
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Michael ,

I want something like this http://www.java2s.com/Code/Java/Swing-Components/GroupableGroupHeaderExample.htm but wanted to know if i really need to write so many classes for this?

Pooja
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> wanted to know if i really need to write so many classes for this?

doubtful it would work without them.

I recall something about rowSorters reacting funny to those classes,
so if you also wanted row sorting, those classes may require a major rewrite.
 
reply
    Bookmark Topic Watch Topic
  • New Topic