This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

SplitPane causes headache when resizing...  RSS feed

 
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!!!
 
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?
 
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):
 
Evacuate the building! Here, take this tiny ad with you:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!