Article View: borland.public.jbuilder.java.swing
Article #10937Re: JSplitPane - how to control divider location?
From: Tad Frysinger TeamB Tad Frysinge...
Date: Tue, 27 Jul 1999 00:00
Date: Tue, 27 Jul 1999 00:00
38 lines
1841 bytes
1841 bytes
In article <7nl0ch$5ho11@forums.borland.com>, slneo@cybergal.com says...
> Hi,
>
> I have used a JSplitPane to split 2 JScrollPane so that one is above the
> other. At run time initially, the top scrollpane contains a JTree while the
> bottom one does not contain any child component yet.
> The problem is, when my app runs, the divider is located such that the top
> scrollpane is not seen, the rest of the space is occupied by the bottom
> scrollpane.
> How to control the divider location so that both scrollpanes are equally
> visible?
> I've used the setDividerLocation() method and it works only during design
> time but not run time.
>
> --
> Thanks for any help given
>
> Lois
>
>
>
Be sure that the splitpane that is incorporated within the other has a
null layout. This works for me:
// Set the SplitPanel appropriately
masterSplit.setOneTouchExpandable(true);
masterSplit.setDividerSize(5);
subSplit.setOneTouchExpandable(true);
subSplit.setDividerSize(5);
subSplit.setTopComponent(conControlPanel);
subSplit.setBottomComponent(SRBean);
subSplit.setBorder( null );
masterSplit.setLeftComponent( conMetaTree ); // a JTree
masterSplit.setRightComponent( subSplit ); // The other splitter
MasterPanel.add(masterSplit, BorderLayout.CENTER);
Tad Frysinger (TeamB)
Technical Details
Message-ID:
<MPG.1207bb7bb5e3ffe2989686@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7nl0ch$5ho11@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,d93cae09098feac5,start X-Google-Attributes: gid111d45,public From: Tad Frysinger (TeamB) (Tad Frysinger) Subject: Re: JSplitPane - how to control divider location? Date: 1999/07/27 Message-ID: <MPG.1207bb7bb5e3ffe2989686@forums.borland.com> X-Deja-AN: 505901031 References: <7nl0ch$5ho11@forums.borland.com> Organization: RTOne Newsgroups: borland.public.jbuilder.java.swing