The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.



Posted by Gerard Peregrin on September 21, 2000 at 8:00 PM

If JScrollPanes (SP1) and (SP2) are the children of a JSplitPane AND the JSplitPane is added to a Content Pane AND a statement adding either SP1 or SP2 to a JPanel (P3) is included after the JSplitPane statement and before the Content Pane statements, then the rendered JSplitPane shows only the child that was NOT added to P3. The division bar is placed against the far left or far right of the JSplitPane. In addition, the dimensions of the first child in a horizontally aligned JSplitPane are adjusted by the methods used to create the JSplitPane (depending on the dimensions of the JScrollPanes, the position of the divider bar and the size of the Content Pane). I would have guessed that the dimension properties of a child JScrollPane would not be affected by instantiating a JSplitPane - assuming mutual exclusivity. I assumed incorrectly. I would appreciate any comments anyone would care to share regarding my misunderstanding. That is (1) that the dimension properties of a JScrollPane that is the child of a JSplitPane remain in tack even after instantiating the JSplitPane, and (2) that the missing JScrollPane component in the JSplitPane should not be missing when the JScrollPane component is added to a JPanel prior to the statement that adds the JSplitPane to the Content Pane.

JScrollPane statement
JScrollPane statement
JSplitPane statement
JPanel statement adding either JScrollPane
ContentPane statement adding JSplitPane


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us