Package sun.awt

Examples of sun.awt.SunToolkit


    }

    final void modalityPushed() {
        Toolkit tk = Toolkit.getDefaultToolkit();
        if (tk instanceof SunToolkit) {
            SunToolkit stk = (SunToolkit)tk;
            stk.notifyModalityPushed(this);
        }
    }
View Full Code Here


    }

    final void modalityPopped() {
        Toolkit tk = Toolkit.getDefaultToolkit();
        if (tk instanceof SunToolkit) {
            SunToolkit stk = (SunToolkit)tk;
            stk.notifyModalityPopped(this);
        }
    }
View Full Code Here

            if (doubleBufferingEnabled && !nativeDoubleBuffering) {
                switch (bufferStrategyType) {
                case BUFFER_STRATEGY_NOT_SPECIFIED:
                    Toolkit tk = Toolkit.getDefaultToolkit();
                    if (tk instanceof SunToolkit) {
                        SunToolkit stk = (SunToolkit) tk;
                        if (stk.useBufferPerWindow()) {
                            paintManager = new BufferStrategyPaintManager();
                        }
                    }
                    break;
                case BUFFER_STRATEGY_SPECIFIED_ON:
View Full Code Here

    }

    final void modalityPopped() {
        Toolkit tk = Toolkit.getDefaultToolkit();
        if (tk instanceof SunToolkit) {
            SunToolkit stk = (SunToolkit)tk;
            stk.notifyModalityPopped(this);
        }
    }
View Full Code Here

    }

    final void modalityPushed() {
        Toolkit tk = Toolkit.getDefaultToolkit();
        if (tk instanceof SunToolkit) {
            SunToolkit stk = (SunToolkit)tk;
            stk.notifyModalityPushed(this);
        }
    }
View Full Code Here

    }

    final void modalityPopped() {
        Toolkit tk = Toolkit.getDefaultToolkit();
        if (tk instanceof SunToolkit) {
            SunToolkit stk = (SunToolkit)tk;
            stk.notifyModalityPopped(this);
        }
    }
View Full Code Here

            if (doubleBufferingEnabled && !nativeDoubleBuffering) {
                switch (bufferStrategyType) {
                case BUFFER_STRATEGY_NOT_SPECIFIED:
                    Toolkit tk = Toolkit.getDefaultToolkit();
                    if (tk instanceof SunToolkit) {
                        SunToolkit stk = (SunToolkit) tk;
                        if (stk.useBufferPerWindow()) {
                            paintManager = new BufferStrategyPaintManager();
                        }
                    }
                    break;
                case BUFFER_STRATEGY_SPECIFIED_ON:
View Full Code Here

        };

        Sysout.createDialog( );
        Sysout.printInstructions( instructions );

        SunToolkit tk = (SunToolkit) Toolkit.getDefaultToolkit();
        if ("sun.awt.motif.MToolkit".equals(tk.getClass().getName())) {
            System.out.println("We shouldn't test MToolkit.");
            EmbeddedFrameTest1.pass();
            return;
        }

        try {
            final Frame frame = new Frame("AWT Frame");
            frame.pack();
            frame.setSize(200,200);

            final Frame embedded_frame = Util.createEmbeddedFrame(frame);
            embedded_frame.setSize(200, 200);
            Sysout.println("embedded_frame = " + embedded_frame);

            final JPopupMenu menu = new JPopupMenu();
            JButton item = new JButton("A button in popup");
            item.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        System.out.println("Button pressed");
                    }
                });

            menu.add(item);

            final JButton btn = new JButton("Press me to see popup");
            btn.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        menu.show(btn, 0, btn.getHeight());
                    }
                });
            final Panel p = new Panel();
            p.setLayout(new BorderLayout());
            embedded_frame.add(p,BorderLayout.CENTER);
            embedded_frame.validate();
            p.add(btn);
            p.validate();
            frame.setVisible(true);
            Robot robot = new Robot();
            tk.realSync();
            Util.clickOnComp(btn, robot);
            tk.realSync();

            Util.clickOnComp(item, robot);
            tk.realSync();
            if (item.getMousePosition() == null) {
                throw new RuntimeException("Popup was not closed (mouse above it)");
            }
            embedded_frame.remove(p);
            embedded_frame.dispose();
View Full Code Here

        setLocationRelativeTo(null);
    }


    public static void main(String[] args) throws Exception {
        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                frame = new ComponentTest();
                frame.setVisible(true);
            }
        });
        toolkit.realSync();
        UIManager.LookAndFeelInfo[] lafs = UIManager.getInstalledLookAndFeels();
        for (final UIManager.LookAndFeelInfo laf : lafs) {
            SwingUtilities.invokeAndWait(new Runnable() {
                public void run() {
                    try {
                        UIManager.setLookAndFeel(laf.getClassName());
                    } catch (Exception e) {
                        new RuntimeException(e);
                    }
                    SwingUtilities.updateComponentTreeUI(frame);
                }
            });
            toolkit.realSync();
        }
    }
View Full Code Here

    }

    final void modalityPushed() {
        Toolkit tk = Toolkit.getDefaultToolkit();
        if (tk instanceof SunToolkit) {
            SunToolkit stk = (SunToolkit)tk;
            stk.notifyModalityPushed(this);
        }
    }
View Full Code Here

TOP

Related Classes of sun.awt.SunToolkit

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.