Hi Stuart,

Thanks for finding the bug.

We have created an issue: https://www.canoo.com/jira/browse/UBA-6992.

It will be fixed in a future release.

However, there is a workaround (please see the above issue).

Before setting the divider location, do an explicit upload() on the
splitpane:

            ULCSplitPane topSplit = new
ULCSplitPane(ULCSplitPane.VERTICAL_SPLIT, tree1, tree2);
            topSplit.upload();
            final ULCSplitPane bottomSplit = new
ULCSplitPane(ULCSplitPane.VERTICAL_SPLIT, topSplit, tree3);
            bottomSplit.upload();

            getContentPane().add(bottomSplit, ULCBorderLayoutPane.CENTER);
            topSplit.setDividerLocation(200);
            bottomSplit.setDividerLocation(300);

Thanks and regards,

Janak

>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] Behalf Of Stuart Booth
>Sent: Wednesday, August 16, 2006 3:17 AM
>To: [email protected]
>Subject: [ULC-developer] setDividerLocation bug
>
>
>I am using 6.1.1 and discovered that the setDividerLocation(int) doesn't
>seem to be working properly. In the example below, the calls to set the
>location don't seem to have any effect. Below this example, I have
>included
>the identical Swing app, which shows how it is supposed to work.
>
>I would appreciate you confirming this and offering and advice as to a
>resolution or workaround.
>
>Thanks.
>-Stuart Booth (Abacus Research)
>
>public class BugsFrameApp extends AbstractApplication {
>    public void start() {
>        new BugsFrame().setVisible(true);
>    }
>
>    public static void main(String[] args) {
>        DevelopmentRunner.setApplicationClass(BugsFrameApp.class);
>        DevelopmentRunner.run();
>    }
>
>    class BugsFrame extends ULCFrame {
>        public BugsFrame() {
>            super("Bugs");
>            setDefaultCloseOperation(ULCFrame.TERMINATE_ON_CLOSE);
>            setSize(800,900);
>            addComponents();
>        }
>
>        private void addComponents() {
>            ULCComponent tree1 = new ULCScrollPane(new ULCTree()) ;
>            ULCComponent tree2 = new ULCScrollPane(new ULCTree());
>            ULCComponent tree3 = new ULCScrollPane(new ULCTree());
>
>            ULCSplitPane topSplit = new
>ULCSplitPane(ULCSplitPane.VERTICAL_SPLIT, tree1, tree2);
>            ULCSplitPane bottomSplit = new
>ULCSplitPane(ULCSplitPane.VERTICAL_SPLIT, topSplit, tree3);
>
>            add(bottomSplit, ULCBorderLayoutPane.CENTER);
>
>            bottomSplit.setDividerLocation(600);
>            topSplit.setDividerLocation(300);
>        }
>    }
>}
>
>This is the Swing app that works fully:
>
>public class BugsFrameApp extends JFrame {
>    public static void main(String[] args) {
>        new BugsFrameApp().setVisible(true);
>    }
>
>    public BugsFrameApp() {
>        super("Bugs");
>        setDefaultCloseOperation(ULCFrame.TERMINATE_ON_CLOSE);
>        setSize(800, 900);
>        addComponents();
>    }
>
>    private void addComponents() {
>        JComponent tree1 = new JScrollPane(new JTree());
>        JComponent tree2 = new JScrollPane(new JTree());
>        JComponent tree3 = new JScrollPane(new JTree());
>
>        JSplitPane topSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
>tree1, tree2);
>        JSplitPane bottomSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
>topSplit, tree3);
>
>        add(bottomSplit, ULCBorderLayoutPane.CENTER);
>
>        bottomSplit.setDividerLocation(600);
>        topSplit.setDividerLocation(300);
>    }
>}
>
>_______________________________________________
>ULC-developer mailing list
>[email protected]
>http://lists.canoo.com/mailman/listinfo/ulc-developer

_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to