• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SplitPane causes headache when resizing...

 
Ricardo Estafan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I have some difficulty when using a splitpane, this is my code :

Now when i drag the splitpane to his lowest point, which is not the bottom of the pane and then i resize (make smaller) the GUI and afterwards resize (make bigger) again, the splitpane is set to the bottom of the pane and i can't see my tablepanel anymore. Exactly the same in oposite direction, what can i do to solve this?
Thanks for the help!!!
 
Fuqiang Zhao
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code have two problems:
1.You should not add the "upperPanel" to contentPane, and then add
it to JSplitPane, the Java GUI container only permit add component
to one container.
2.You should use setPreferredSize intead of setMinimumSize for the
"upperPanel".
change you code to:
upperPanel.setPreferredSize(new Dimension(300, 150));
and remove the code:
contentPane.add(upperPanel, BorderLayout.NORTH);
 
Ricardo Estafan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot,
i did as you said but when i resize the frame still when the splitpane touches the bottom or top of the frame it stays there when i resize back again...
Can someone help?
 
maggie woo
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it critical that you have the oneTouchExpandable(true)?
Try it without this, and see if it does more or less what you want.
 
maggie woo
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, here's some code from one of mine that doesn't seem to have this problem (or if it does, then maybe I don't understand the problem):
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic