Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSplitPane not moving divider

 
Derek Boring
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JFrame with a JSplitPane in it. The divider will drag to the right, but it will not drag to the left. I can't figure out why. Could someone help me see what i'm overlooking?

Here's the code that creates the split pane and the stuff in it. The left side is a bunch of JLabels and the right side is JTextAreas each in their own JScrollPane. Each side of the split pane has its own JPanel that contains everything. (pnlLeft and pnlRight)



Of course I create each object and put it in it's place in the array, and i assume you won't need to see that but if you do, just ask.

Here is the code that add's everything to the JFrame:


Note that there is a JPanel above the split pane (in the NORTH position of the GridLayout) with a JLabel and JComboBox in it.

As i stated before, the I can drag the divider to the right and it works fine, but it will not drag to the left. It doesn't even show the shadow when i attempt to drag it left.
 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please make sure that you have the prefeered size and the minimum size of both the component in splitPane properly set.
Thats the one reason, why it could have had happening.
 
Derek Boring
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks much, fixed it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic