Package javax.swing

Examples of javax.swing.JPanel.doLayout()


        panel.add(c5, cc.xy(5, 1));
        panel.add(c6, cc.xy(6, 1));
        panel.add(c7, cc.xy(7, 1));
        panel.add(c8, cc.xy(8, 1));

        panel.doLayout();

        assertEquals("max(10px;c1_min).width",   10, c1.getWidth());
        assertEquals("max(10px;c2_min).width",   20, c2.getWidth());
        assertEquals("max(10px;c3_pref).width"10, c3.getWidth());
        assertEquals("max(10px;c4_pref).width"40, c4.getWidth());
View Full Code Here


        panel.add(c5, cc.xy(1, 5));
        panel.add(c6, cc.xy(1, 6));
        panel.add(c7, cc.xy(1, 7));
        panel.add(c8, cc.xy(1, 8));

        panel.doLayout();

        assertEquals("[10px, c1_min].height"10, c1.getHeight());
        assertEquals("[10px, c2_min].height"20, c2.getHeight());
        assertEquals("[10px,c3_pref].height"10, c3.getHeight());
        assertEquals("[10px,c4_pref].height"40, c4.getHeight());
View Full Code Here

        panel.add(c3, cc.xy (3, 1));
        panel.add(c4, cc.xyw(1, 2, 2));

        Dimension preferredLayoutSize = layout.preferredLayoutSize(panel);
        panel.setSize(preferredLayoutSize);
        panel.doLayout();
        int col1And2Width = c2.getX() + c2.getWidth();
        int gridWidth     = c3.getX() + c3.getWidth();
        int totalWidth    = preferredLayoutSize.width;

        assertEquals("Col1+2 width", 25, col1And2Width);
View Full Code Here

        panel.add(c3, cc.xy (3, 1));
        panel.add(c4, cc.xyw(1, 2, 2));

        Dimension preferredLayoutSize = layout.preferredLayoutSize(panel);
        panel.setSize(preferredLayoutSize);
        panel.doLayout();
        int col1And2Width = c2.getX() + c2.getWidth();
        int gridWidth     = c3.getX() + c3.getWidth();
        int totalWidth    = preferredLayoutSize.width;

        assertEquals("Col1+2 width"25, col1And2Width);
View Full Code Here

        panel.add(c3, cc.xy (3, 1));
        panel.add(c4, cc.xyw(1, 2, 2));

        Dimension preferredLayoutSize = layout.preferredLayoutSize(panel);
        panel.setSize(preferredLayoutSize);
        panel.doLayout();
        int col1And2Width = c2.getX() + c2.getWidth();
        int gridWidth     = c3.getX() + c3.getWidth();
        int totalWidth    = preferredLayoutSize.width;

        assertEquals("Col1+2 width"50, col1And2Width);
View Full Code Here

        assertEquals("Minimum layout height", 10, minimumLayoutSize.height);
        assertEquals("Preferred layout width"50, preferredLayoutSize.width);
        assertEquals("Preferred layout height", 50, preferredLayoutSize.height);

        panel.setSize(minimumLayoutSize);
        panel.doLayout();
        int columnWidth = c1.getWidth();
        int rowHeight = c1.getHeight();
        assertEquals("Column width (container min)", 10, columnWidth);
        assertEquals("Row height (container min)", 10, rowHeight);
View Full Code Here

        int rowHeight = c1.getHeight();
        assertEquals("Column width (container min)", 10, columnWidth);
        assertEquals("Row height (container min)", 10, rowHeight);

        panel.setSize(preferredLayoutSize);
        panel.doLayout();
        columnWidth = c1.getWidth();
        rowHeight = c1.getHeight();
        assertEquals("Column width (container pref)", 50, columnWidth);
        assertEquals("Row height (container pref)", 50, rowHeight);
    }
View Full Code Here

        assertEquals("Minimum layout height", 20, minimumLayoutSize.height);
        assertEquals("Preferred layout width"50, preferredLayoutSize.width);
        assertEquals("Preferred layout height", 50, preferredLayoutSize.height);

        panel.setSize(minimumLayoutSize);
        panel.doLayout();
        int columnWidth = c1.getWidth();
        int rowHeight = c1.getHeight();
        assertEquals("Column width (container min)", 20, columnWidth);
        assertEquals("Row height (container min)", 20, rowHeight);
View Full Code Here

        int rowHeight = c1.getHeight();
        assertEquals("Column width (container min)", 20, columnWidth);
        assertEquals("Row height (container min)", 20, rowHeight);

        panel.setSize(preferredLayoutSize);
        panel.doLayout();
        columnWidth = c1.getWidth();
        rowHeight = c1.getHeight();
        assertEquals("Column width (container pref)", 50, columnWidth);
        assertEquals("Row height (container pref)", 50, rowHeight);
    }
View Full Code Here

        assertEquals("Minimum layout height", 10, minimumLayoutSize.height);
        assertEquals("Preferred layout width"20, preferredLayoutSize.width);
        assertEquals("Preferred layout height", 20, preferredLayoutSize.height);

        panel.setSize(minimumLayoutSize);
        panel.doLayout();
        int columnWidth = c1.getWidth();
        int rowHeight = c1.getHeight();
        assertEquals("Column width (container min)", 10, columnWidth);
        assertEquals("Row height (container min)", 10, rowHeight);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.