I've tried everything that I can find from the Java 1.4.2 API specs for
JSplitPane in order to control the splitter, but almost nothing works. I
can manually drag it into the place I want, but no code I write affects
it, or actually works the way it says it should.
I have a splitpane as follows.
|======|======|
| | |
|======|======|
And I'd like it to look like this : which is as far as it stretches to the
right, but I cant get it to work in code.
|=========|===|
| | |
|=========|===|
Any ideas or suggestions are extremely welcome. I've deleted all my code
except for the creation of JSplitPane because nothing I tried worked.
~ Matthew
Matthew Metnetsky - 06 Jan 2004 16:37 GMT
Hello,
> I've tried everything that I can find from the Java 1.4.2 API specs for
> JSplitPane in order to control the splitter, but almost nothing works. I
[quoted text clipped - 18 lines]
>
> ~ Matthew
The boxes don't appear to have be displaying correctly above, but I'd
imagine its enough to get the general gist of my problem.
Thanks in advance,
~ Matthew
Steve W. Jackson - 06 Jan 2004 17:34 GMT
>:Hello,
>:
[quoted text clipped - 29 lines]
>:
>:~ Matthew
I presume you've tried setDividerLocation() or setDividerSize()? But
those may not do much if you've got layout management that causes some
shifting to occur (I've had trouble with these in the past, too). You
might try setting one of those values after you call pack().
= Steve =

Signature
Steve W. Jackson
Montgomery, Alabama
ak - 06 Jan 2004 23:10 GMT
> I've tried everything that I can find from the Java 1.4.2 API specs for
> JSplitPane in order to control the splitter, but almost nothing works. I
> can manually drag it into the place I want, but no code I write affects
> it, or actually works the way it says it should.
ensure that both components are in JScrollPane and don't set preferredSize
explicitly.
always call setDividerLocation from EDT
if this don't work try following:
SwingUtilities.invokeLater(new Runnable() {
public void run() {
splitPane.setDividerLocation(location);
}
};
it may be needed because, something changes divider location _after_ you set
it and you think that your code has no affect.
____________
http://reader.imagero.com the best java image reader.