• 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

JTabbedPane Problem

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having a problem with a JTabbedPane I'm trying to implement.
Whenever I click on any part of the tabbed pane, the JSplitPane I have on the tab is resixing itself for some reason.
Anyone have a clue whats going on?


[ April 02, 2003: Message edited by: Stewart Griffin ]
 
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,
just a suggestion:
- set the preferred size of the components in the splitpane, that is: the list and the text area.
- do not set the divider location.
- do not set the size of the frame, but call frame.pack() instead.
The result should be that the splitpane adjusts to display its components according to their preferred size. In consequence, the tabbed pane and frame will be sized appropriately. the splitpane should not re-adjust in that case.

(just on the side:
- instead of adding a windowlistener to the frame, you can set frame.setDefaultClosingOperation(JFrame.EXIT_ON_CLOSE).
- in >= 1.4 you can use frame.setLocationRelativeTo(null) to center the frame on the screen, or - if you provide an argument - place it relative to another frame.)
cheers,
Chantal
reply
    Bookmark Topic Watch Topic
  • New Topic