Solved

JSplitPane divider movement problem

Posted on 2004-04-21
3
686 Views
Last Modified: 2007-12-19
I'm using a JSplitPane having a JPanel on both the left and right.  When I start out the divider moves perfectly fine in both directions, But when I change the JPanels to something different I am unable to move the to the right. When I use setDividerLocation(.5), it sets the divider where I want, but then when I click to move the divider bar left and right it moves to the right and I can't move it to the left. After it is moved to the right, then I can move the divider bar left and right, but not past where it just was moved to.  is there anyway to allow the divider bar to move all the way left and right.  If not, is there a way to not allow the user to move the divider bar?

Thanks in advance.
0
Comment
Question by:greg_100
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Webstorm earned 250 total points
ID: 10882999
Hi greg_100,

I think you should check the minimum & maximum size returned by the 2 components contained in the JSplitPane.

Can you post the code ?
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10886187
>> when I change the JPanels to something different
You mean you remove the panels and add a new ones to replace them?

Do you perform a

      revalidate();
      repaint();
and
      pack();

on the panel containing the split pane?

>>Can you post the code ?
That would indeed help us helping you
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10887653
That was a quicky
;)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now