Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Workaround to position splitter?

Posted on 1999-07-10
Medium Priority
Last Modified: 2010-05-18
I'm trying to position a horizontal splitter bar, and no matter what value I use for


it doesn't seem to have any affect.  (I've tried 0.5, 0.1, etc)  My splitter has setOneTouchExpandable = true, and its size is 10 in case it matters.  

NT/98, Swing 1.0.1

Question by:tsxtsx
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

conick earned 400 total points
ID: 1245714
The components on both sides of the divider may already be at its minimum size.
The divider cannot make a component less than its minimum size.
The divider uses the preferred size of the components to set its initial position.  However there are many times that preferredSize == minimumSize when you dont explicitly set the minimumSize or preferredSize.
(I didnt say that very well)
To make my gibberish make sense:
Explicitly set the minimum size of each of the components with (setMinimumSize()).  This should allow the divider to move.

Author Comment

ID: 1245715
Still doesn't work -- both sides of the splitter have preferred sizes of 300,300 and min sizes of 2,2 and it still won't move.

Other ideas?

Expert Comment

ID: 1245716
I thought for sure that would work...
You may want to reject my answer so other experts may feel more inclined to get involved..
Also, please post the code you are using.. or better yet give an runnable example that demonstrates the problem?
Does it work when you specify pixels instead of percentages?
Is this only a problem when you programmically try to set the divider location or is it a problem with manual moves also?

Expert Comment

ID: 6827889
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  Or if you are an EE Pro user, click the link below to select open items for your Member ID using Power Search:

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.
Thank you,
Moderator @ Experts Exchange

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.

670 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