Package java.awt

Examples of java.awt.Button


        event.consume();
        assertTrue(event.isConsumed());
    }

    public final void testGetModifiers() {
        Button button = new Button("Button");
        InputEvent event = new InputEvent(button, 0, 1000000000, 0) {};

        event.setModifiers(InputEvent.BUTTON1_MASK);
        assertEquals(event.getModifiers(), InputEvent.BUTTON1_MASK);
        event.setModifiers(InputEvent.BUTTON2_MASK);
View Full Code Here


        event.setModifiers(InputEvent.META_DOWN_MASK);
        assertEquals(event.getModifiers(), InputEvent.META_MASK);
    }

    public final void testGetModifiersEx() {
        Button button = new Button("Button");
        InputEvent event = new InputEvent(button, 0, 1000000000, 0) {};

        event.setModifiers(InputEvent.BUTTON1_MASK);
        assertEquals(event.getModifiersEx(), InputEvent.BUTTON1_DOWN_MASK);
        event.setModifiers(InputEvent.BUTTON2_MASK);
View Full Code Here

        event.setModifiers(InputEvent.META_DOWN_MASK);
        assertEquals(event.getModifiersEx(), InputEvent.META_DOWN_MASK);
    }

    public final void testIsAltDown() {
        Button button = new Button("Button");
        InputEvent event = new InputEvent(button, 0, 1000000000, 0) {};

        assertFalse(event.isAltDown());
        event.setModifiers(InputEvent.ALT_DOWN_MASK);
        assertTrue(event.isAltDown());
View Full Code Here

        event.setModifiers(InputEvent.ALT_DOWN_MASK);
        assertTrue(event.isAltDown());
    }

    public final void testIsAltGraphDown() {
        Button button = new Button("Button");
        InputEvent event = new InputEvent(button, 0, 1000000000, 0) {};

        assertFalse(event.isAltGraphDown());
        event.setModifiers(InputEvent.ALT_GRAPH_DOWN_MASK);
        assertTrue(event.isAltGraphDown());
View Full Code Here

        event.setModifiers(InputEvent.ALT_GRAPH_DOWN_MASK);
        assertTrue(event.isAltGraphDown());
    }

    public final void testIsControlDown() {
        Button button = new Button("Button");
        InputEvent event = new InputEvent(button, 0, 1000000000, 0) {};

        assertFalse(event.isControlDown());
        event.setModifiers(InputEvent.CTRL_DOWN_MASK);
        assertTrue(event.isControlDown());
View Full Code Here

        event.setModifiers(InputEvent.CTRL_DOWN_MASK);
        assertTrue(event.isControlDown());
    }

    public final void testIsMetaDown() {
        Button button = new Button("Button");
        InputEvent event = new InputEvent(button, 0, 1000000000, 0) {};

        assertFalse(event.isMetaDown());
        event.setModifiers(InputEvent.META_DOWN_MASK);
        assertTrue(event.isMetaDown());
View Full Code Here

        event.setModifiers(InputEvent.META_DOWN_MASK);
        assertTrue(event.isMetaDown());
    }

    public final void testIsShiftDown() {
        Button button = new Button("Button");
        InputEvent event = new InputEvent(button, 0, 1000000000, 0) {};

        assertFalse(event.isShiftDown());
        event.setModifiers(InputEvent.SHIFT_DOWN_MASK);
        assertTrue(event.isShiftDown());
View Full Code Here

        final Panel buttonPanel = new Panel();
        buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 20, 0));
        add(buttonPanel, BorderLayout.SOUTH);

        final Button ok = new Button("Close");
        ok.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(final ActionEvent e) {
                ok(true);
            }
        });
View Full Code Here

    list = new List();

    setLayout(new BorderLayout());
    add("Center", list);

    Button clearCashButton = new Button("clear the cache");
    clearCashButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent actionEvent) {
        WeakTable.clear();
      }
    });
    add("South", clearCashButton);
View Full Code Here

        txtResult = new TextArea(20, 40);

        txtCommand.setFont(fFont);
        txtResult.setFont(new Font("Courier", Font.PLAIN, 12));

        butExecute = new Button("Execute");
        butClear   = new Button("Clear");

        butExecute.addActionListener(this);
        butClear.addActionListener(this);
        pCommand.add("East", butExecute);
        pCommand.add("West", butClear);
View Full Code Here

TOP

Related Classes of java.awt.Button

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.