• 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

SplitPane causes headache when resizing...

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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):
reply
    Bookmark Topic Watch Topic
  • New Topic