Package javax.swing.plaf

Examples of javax.swing.plaf.BorderUIResource$EmptyBorderUIResource


        UIManager.put("ToggleButton.select", new ColorUIResource(Color.green));
        UIManager.put("ToggleButton.foreground", new ColorUIResource(Color.cyan));
        UIManager.put("ToggleButton.background", new ColorUIResource(Color.blue));
        Font font = new FontUIResource(button.getFont().deriveFont(100f));
        UIManager.put("ToggleButton.font", font);
        Border border = new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0));
        UIManager.put("ToggleButton.border", border);
        button.setUI(publicUI);
        publicUI.installDefaults(button);
        publicUI.uninstallDefaults(button);
        assertEquals(Color.blue, button.getBackground());
View Full Code Here


            @Override
            public FontMetrics getFontMetrics(Font font) {
                return BasicOptionPaneUITest.this.getFontMetrics(font);
            }
        };
        Border messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(3, 3,
                3, 3));
        UIManager.put("OptionPane.messageAreaBorder", messageAreaBorder);
        messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(4, 4, 4, 4));
        UIManager.put("OptionPane.messageAreaBorder", messageAreaBorder);
        Border border = new BorderUIResource(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        UIManager.put("OptionPane.border", border);
        Dimension minimumSize = new DimensionUIResource(123, 456);
        UIManager.put("OptionPane.minimumSize", minimumSize);
        pane.setUI(paneUI);
        assertNull(paneUI.getPreferredSize(null));
View Full Code Here

        UIManager.put("OptionPane.background", new ColorUIResource(Color.red));
        UIManager.put("OptionPane.foreground", new ColorUIResource(Color.yellow));
        UIManager.put("OptionPane.messageForeground", new ColorUIResource(Color.green));
        Font font = new FontUIResource(pane.getFont().deriveFont(100f));
        UIManager.put("OptionPane.font", font);
        Border border = new BorderUIResource(BorderFactory.createEmptyBorder(1, 1, 1, 1));
        UIManager.put("OptionPane.border", border);
        Dimension minimumSize = new DimensionUIResource(123, 456);
        UIManager.put("OptionPane.minimumSize", minimumSize);
        pane.setUI(paneUI);
        pane.setOptions(new Object[] { "button" });
View Full Code Here

        JOptionPane pane = new JOptionPane();
        String message = "message message message message";
        pane.setUI(paneUI);
        pane.setMessageType(JOptionPane.ERROR_MESSAGE);
        pane.setMessage(message);
        Border messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(3, 3,
                3, 3));
        UIManager.put("OptionPane.messageAreaBorder", messageAreaBorder);
        paneUI.installDefaults();
        assertEquals(messageAreaBorder, ((JComponent) paneUI.createMessageArea()).getBorder());
        messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(4, 4, 4, 4));
        UIManager.put("OptionPane.messageAreaBorder", messageAreaBorder);
        paneUI.installDefaults();
        assertEquals(messageAreaBorder, ((JComponent) paneUI.createMessageArea()).getBorder());
        JComponent messageArea = (JComponent) paneUI.createMessageArea();
        assertTrue(messageArea instanceof JPanel);
View Full Code Here

        paneUI.optionPane = new JOptionPane();
        JButton button;
        paneUI.optionPane.setOptionType(JOptionPane.YES_NO_OPTION);
        int threshold = 111;
        UIManager.put("OptionPane.buttonClickThreshhold", new Integer(threshold));
        Border buttonAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(2, 2, 2,
                2));
        UIManager.put("OptionPane.buttonAreaBorder", buttonAreaBorder);
        paneUI.installDefaults();
        buttonArea = paneUI.createButtonArea();
        assertEquals("class", JPanel.class, buttonArea.getClass());
View Full Code Here

        UIManager.getDefaults().put("MenuBar.foreground", new ColorUIResource(Color.yellow));
        UIManager.getDefaults().put("MenuBar.highlight", new ColorUIResource(Color.cyan));
        UIManager.getDefaults().put("MenuBar.shadow", new ColorUIResource(Color.magenta));
        Font font = new FontUIResource(menuBar.getFont().deriveFont(100f));
        UIManager.getDefaults().put("MenuBar.font", font);
        Border border = new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0));
        UIManager.getDefaults().put("MenuBar.border", border);
        menuBar.setUI(menuBarUI);
        menuBarUI.installDefaults();
        assertEquals(Color.red, menuBar.getBackground());
        assertEquals(Color.yellow, menuBar.getForeground());
View Full Code Here

    }

    public void testGetPreferredSize() {
        Font font = new FontUIResource(new Font("serif", Font.PLAIN, 24));
        UIManager.put("CheckBox.font", font);
        Border border = new BorderUIResource(BorderFactory.createEmptyBorder(11, 11, 11, 11));
        UIManager.put("CheckBox.border", border);
        JCheckBox button1 = new JCheckBox();
        JCheckBox button2 = new JCheckBox("text");
        JCheckBox button3 = new JCheckBox("text");
        JCheckBox button6 = new JCheckBox("text");
View Full Code Here

        UIManager.put("CheckBox.foreground", new ColorUIResource(Color.cyan));
        UIManager.put("CheckBox.background", new ColorUIResource(Color.blue));
        assertNotNull("font is installed", button.getFont());
        Font font = new FontUIResource(button.getFont().deriveFont(100f));
        UIManager.put("CheckBox.font", font);
        Border border = new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0));
        UIManager.put("CheckBox.border", border);
        button.setUI(ui);
        ui.installDefaults(button);
        ui.uninstallDefaults(button);
        assertEquals("background", Color.blue, button.getBackground());
View Full Code Here

        UIManager.put("CheckBox.foreground", new ColorUIResource(Color.cyan));
        UIManager.put("CheckBox.background", new ColorUIResource(Color.blue));
        assertNotNull("font is installed", button.getFont());
        Font font = new FontUIResource(button.getFont().deriveFont(100f));
        UIManager.put("CheckBox.font", font);
        Border border = new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0));
        UIManager.put("CheckBox.border", border);
        button.setUI(ui);
        ui.installDefaults(button);
        assertEquals("background", Color.blue, button.getBackground());
        assertEquals("foreground", Color.cyan, button.getForeground());
View Full Code Here

        UIManager.getDefaults().put("List.foreground", new ColorUIResource(Color.yellow));
        Font font = new FontUIResource(list.getFont().deriveFont(100f));
        UIManager.getDefaults().put("List.font", font);
        DefaultListCellRenderer renderer = new DefaultListCellRenderer.UIResource();
        UIManager.getDefaults().put("List.cellRenderer", renderer);
        Border border = new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0));
        UIManager.getDefaults().put("List.border", border);
        list.setUI(ui);
        ui.installDefaults();
        assertEquals(Color.red, list.getBackground());
        assertEquals(Color.yellow, list.getForeground());
View Full Code Here

TOP

Related Classes of javax.swing.plaf.BorderUIResource$EmptyBorderUIResource

Copyright © 2018 www.massapicom. 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.