Package java.awt

Examples of java.awt.Button$State


        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

  public void createWindow() {

    this.hashMap = new HashMap<Long, List<DataPoint>>();
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Button buttonStart = new Button("Start");
    Button buttonStop = new Button("Stop");
    Button buttonMatch = new Button("Match");
    Button buttonStartMatch = new Button("Start Match");
    Button buttonStopMatch = new Button("Stop Match");
    fileTextField = new JTextField(20);

    fileTextField.setText("/home/wiktor/audio/billy.mp3");

    buttonStart.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {
          try {
            listenSound(nrSong, false);
          } catch (IOException e1) {
            e1.printStackTrace();
          } catch (UnsupportedAudioFileException e1) {
            e1.printStackTrace();
          }
          nrSong++;
        } catch (LineUnavailableException ex) {
          ex.printStackTrace();
        }
      }
    });

    buttonStop.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        running = false;
      }
    });

    buttonStartMatch.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {
          try {
            listenSound(nrSong, true);
          } catch (IOException e1) {
            e1.printStackTrace();
          } catch (UnsupportedAudioFileException e1) {
            e1.printStackTrace();
          }
        } catch (LineUnavailableException ex) {
          ex.printStackTrace();
        }
      }
    });

    buttonStopMatch.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        running = false;
      }
    });
View Full Code Here

     * @return java.awt.Button
     */
    private Button getAboutOkButton() {
        if (iAboutOkButton == null) {
            try {
                iAboutOkButton = new Button();
                iAboutOkButton.setName("AboutOkButton");
                iAboutOkButton.setLabel("OK");
            } catch (Throwable iExc) {
                handleException(iExc);
            }
View Full Code Here

TOP

Related Classes of java.awt.Button$State

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.