• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

JTable with multicolumn header

 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
I want to create a JTable with column headers that span over three columns. I tried to use the sample code of this site:
http://www2.gol.com/users/tame/swing/examples/JTableExamples1.html
but that does not work well: the column header width is computed slightly to wide. Moreover, if I change the intercellspacing of the table, the difference between the column header width and the width of three actual columns gets "really", the header than span over say five or more columns.
I tried to change the algorithm that computes the width in different ways, but that actually changed nothing. I have the suspicion that the column width that is used as the base for the column header width computation is not the actual width that is displayed in the end.
has someone done anything similar? (I am using JDK 1.4 and greater)
cheers
 
I love a good mentalist. And so does this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic