Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to tell JSplitPane to ignore preferred sizes?  RSS feed

 
Tom McC
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSplitPane that, on one particular screen, will let you move it one direction but then not back again, even to where it started out. I've removed all the references to preferred sizes that I could, and still it won't let me size it again. Is there a way to "force" the contents of a split pane to be resized, disregarding their minimum or preferred sizes (without using an ugly scroll pane)?

Thanks, Tom
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
post a small demo program -
just a frame, a splitpane, 2 panels, and whatever sizing you have,
just enough to display the behaviour.
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tom

Set the preferred size of the component which is added into the JSplitPane instead. It must work.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!