I'm looking for a way to initially set my divider location of my
JSplitPane all the way to the bottom (vertical split), as if it were
pulled all the way down and only shows the top component.
I know there's the setDividerLocation() that requires the size of the
window height, but is there an easier way to set it all the way down
w/o needing to know the size? That way, no matter what I resize my
window too, the divider will be all the way at the bottom?
Vova Reznik - 12 Oct 2005 19:45 GMT
> I'm looking for a way to initially set my divider location of my
> JSplitPane all the way to the bottom (vertical split), as if it were
[quoted text clipped - 4 lines]
> w/o needing to know the size? That way, no matter what I resize my
> window too, the divider will be all the way at the bottom?
http://java.sun.com/docs/books/tutorial/uiswing/components/splitpane.html#divider
Henk van Voorthuijsen - 13 Oct 2005 09:03 GMT
> I'm looking for a way to initially set my divider location of my
> JSplitPane all the way to the bottom (vertical split), as if it were
[quoted text clipped - 4 lines]
> w/o needing to know the size? That way, no matter what I resize my
> window too, the divider will be all the way at the bottom?
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JSplitPane.html#setDividerLo
cation(double)
jessu - 13 Oct 2005 12:40 GMT
setDividerLocation( 1.0 )
-------------------
FeedTV : View your blogs. Dont just read.
http://www.feedfeeds.com/feedtv
William Z. - 01 Nov 2005 22:05 GMT
I've done this, but it doesn't set my divider to the bottom. If I use
an int value, it goes down, but when using a double value of 1.0
(percentage), it doesn't go all the way down.
Michael Dunn - 01 Nov 2005 23:07 GMT
(frame.)setVisible(true);
splitPane.setDividerLocation(1.0 ); //add it after it is visible
William Z. - 01 Nov 2005 23:37 GMT
That didn't make any difference either.
rightSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
tabbedPane, statusPanel);
rightSplitPane.setVisible(true);
rightSplitPane.setOneTouchExpandable(true);
rightSplitPane.setDividerLocation(1.0);
Any other ideas what could be stopping this from happening?
Michael Dunn - 01 Nov 2005 23:49 GMT
rightSplitPane.setVisible(true); //<---it is the frame/contentPane that
needs to be visible
ie
setVisible(true);//if extending JFrame, or
frame.setVisible(true);// if composing JFrame
William Z. - 02 Nov 2005 17:50 GMT
Hmmm, I tried this too.
Could it be that my main class extends JFrame and implements Runnable,
then within the run method, which is invoked with
EventQueue.invokeLater(myClass), is where I build my GUI. I don't see
what could be wrong, but ... I can't figure why my splitBar shows up,
just not initially down at the bottom. When I start my app, it just
won't show up all the way down at the bottom, unless I click on the the
one touch exapandable arrow to make it drop down.
Michael Dunn - 02 Nov 2005 22:42 GMT
start with this, then add your bits of code - small
sections at a time. Compile/run after each addition,
eventually you will find the part that breaks what
is supposed to happen
import javax.swing.*;
import java.awt.*;
class Testing extends JFrame
{
public Testing()
{
setSize(300,200);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLocation(400,200);
JPanel p1 = new JPanel();
p1.add(new JLabel("Hello"));
JPanel p2 = new JPanel();
p2.add(new JLabel("World"));
JSplitPane spt= new JSplitPane(JSplitPane.VERTICAL_SPLIT,p1,p2);
getContentPane().add(spt);
setVisible(true);
spt.setDividerLocation(1.0);
}
public static void main( String args[] ){new Testing();}
}
Roedy Green - 14 Oct 2005 01:22 GMT
>I know there's the setDividerLocation() that requires the size of the
>window height, but is there an easier way to set it all the way down
>w/o needing to know the size?
see http://mindprod.com/jgloss/jsplitpane.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.