• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTabbedPane Problem  RSS feed

 
Stewart Griffin
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • 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 ]
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!