Package java.awt

Examples of java.awt.Button


  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

     * @return Button
     */
    private Button getBrowseButton() {
        if (iBrowseButton == null) {
            try {
                iBrowseButton = new Button();
                iBrowseButton.setName("BrowseButton");
                iBrowseButton.setLabel("...");
            } catch (Throwable iExc) {
                handleException(iExc);
            }
View Full Code Here

     * @return java.awt.Button
     */
    private Button getBuildButton() {
        if (iBuildButton == null) {
            try {
                iBuildButton = new Button();
                iBuildButton.setName("BuildButton");
                iBuildButton.setLabel("Execute");
            } catch (Throwable iExc) {
                handleException(iExc);
            }
View Full Code Here

     * @return java.awt.Button
     */
    private Button getCloseButton() {
        if (iCloseButton == null) {
            try {
                iCloseButton = new Button();
                iCloseButton.setName("CloseButton");
                iCloseButton.setLabel("Close");
            } catch (Throwable iExc) {
                handleException(iExc);
            }
View Full Code Here

     * @return java.awt.Button
     */
    private Button getMessageClearLogButton() {
        if (iMessageClearLogButton == null) {
            try {
                iMessageClearLogButton = new Button();
                iMessageClearLogButton.setName("MessageClearLogButton");
                iMessageClearLogButton.setLabel("Clear Log");
            } catch (Throwable iExc) {
                handleException(iExc);
            }
View Full Code Here

     * @return java.awt.Button
     */
    private Button getMessageOkButton() {
        if (iMessageOkButton == null) {
            try {
                iMessageOkButton = new Button();
                iMessageOkButton.setName("MessageOkButton");
                iMessageOkButton.setLabel("Close");
            } catch (Throwable iExc) {
                handleException(iExc);
            }
View Full Code Here

     * @return java.awt.Button
     */
    private Button getReloadButton() {
        if (iReloadButton == null) {
            try {
                iReloadButton = new Button();
                iReloadButton.setName("ReloadButton");
                iReloadButton.setLabel("(Re)Load");
            } catch (Throwable iExc) {
                handleException(iExc);
            }
View Full Code Here

     * @return java.awt.Button
     */
    private Button getStopButton() {
        if (iStopButton == null) {
            try {
                iStopButton = new Button();
                iStopButton.setName("StopButton");
                iStopButton.setLabel("Stop");
                iStopButton.setEnabled(false);
            } catch (Throwable iExc) {
                handleException(iExc);
View Full Code Here

    private void createButtonsPanel() {
        final Panel buttons = new Panel(new FlowLayout(FlowLayout.RIGHT));
        add(buttons, BorderLayout.SOUTH);

        buttons.add(cancel = new Button(CANCEL_LABEL));
        cancel.addActionListener(this);
        cancel.addKeyListener(this);

        buttons.add(login = new Button(LOGIN_LABEL));
        login.addActionListener(this);
        login.addKeyListener(this);
    }
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.