• 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

Can't control BoxLayout when adding JTableHeader

 
Ranch Hand
Posts: 525
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good morning to all. I'm having BoxLayout trouble. In this code the header demands
extra space on the right and the table body demands extra space on the left. But I need
the box to be as narrow as possible. (I'm adding a border to see the box size.) I've been
avoiding using a JScrollPane. Any ideas?

Jim ...
 
Jim Hoglund
Ranch Hand
Posts: 525
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Careful attention to component alignment and sizes eventually solved the problem. Adding
borders to each container, and printing MIN, PREFERRED, MAX sizes to the console helped
to see that was going on. The Box class is very handy and seems easy to work with. I can
elaborate further on where I ended up, if anyone is interested. Also, I wonder what others
think about the Group layout manager.

Jim...
 
reply
    Bookmark Topic Watch Topic
  • New Topic