Package java.awt

Examples of java.awt.Button


            c.actionPerformed(new ActionEvent(this, 0, "console"));
            assertContains(lastUrl, ":9002");
            lastUrl = "-";
            // double-click prevention is 100 ms
            Thread.sleep(200);
            MouseEvent me = new MouseEvent(new Button(), 0, 0, 0, 0, 0, 0, false, MouseEvent.BUTTON1);
            c.mouseClicked(me);
            assertContains(lastUrl, ":9002");
            lastUrl = "-";
            // no delay - ignore because it looks like a double click
            c.mouseClicked(me);
View Full Code Here


    // =================================
    selectionPanel = new Panel();
    selectionPanel.setLayout(new BorderLayout());
    selectionPanel.add(new Label("Demo", Label.CENTER), BorderLayout.NORTH);

    Button fullScreen = new Button("Fullscreen");
    fullScreen.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent event) {
        toggleFullscreen();
      }
    });
View Full Code Here

        if (isWindows) {
            urlText.setFocusable(false);
        }
        mainPanel.add(urlText, constraintsTextField);

        startBrowser = new Button("Start Browser");
        startBrowser.setFocusable(false);
        startBrowser.setActionCommand("console");
        startBrowser.addActionListener(this);
        startBrowser.setFont(font);
        mainPanel.add(startBrowser, constraintsButton);
View Full Code Here

      GridBagConstraints gbc = new GridBagConstraints();
      gbc.fill = GridBagConstraints.BOTH;
      gbc.insets = new Insets(5,5,5,5);

      // Exit Button
      exitButton = new Button("Exit");
      class BeepListener implements ActionListener {
         public void actionPerformed(ActionEvent e) {
            toolkit.beep();
            if (clientQuery != null)
               clientQuery.logout();
            //unregisterLogEvents();
            log.info("Good bye!");
            System.exit(0);
         }
      }
      exitButton.addActionListener(new BeepListener());
      gbc.gridx=0; gbc.gridy=0; gbc.gridwidth=1; gbc.gridheight=1;
      gbc.weightx = gbc.weighty = 0.0;
      add(exitButton, gbc);

      // Hide Button
      hideButton = new Button("Hide Window");
      class HideListener implements ActionListener {
         public void actionPerformed(ActionEvent e) {
            hideWindow();
         }
      }
      hideButton.addActionListener(new HideListener());
      gbc.gridx=1; gbc.gridy=0; gbc.gridwidth=1; gbc.gridheight=1;
      gbc.weightx = gbc.weighty = 0.0;
      add(hideButton, gbc);

      // Statistic display with fill level bars
      int offset = 0;
      gbc.gridx=offset; gbc.gridy=1; gbc.gridwidth=1; gbc.gridheight=1;
      gbc.weightx = gbc.weighty = 0.0;
      createBarPanel(publishedMessagesBar, publishedLabel, "Published", gbc, offset++);
      createBarPanel(sentMessagesBar,      sentLabel,      "Update",    gbc, offset++);
      createBarPanel(getMessagesBar,       getLabel,       "Get",       gbc, offset++);


      // XPath query GUI
         Panel panel = new Panel();
         panel.setName("QueryPanel");
         panel.setLayout(new BorderLayout());
         panel.setBackground(java.awt.SystemColor.control);

         // Field to enter XPath text
            Panel inputPanel = new Panel();
            inputPanel.setLayout(new BorderLayout());

            Label inputLabel = new Label("XPath query: ");
            inputPanel.add("West", inputLabel);

            inputTextField.setText("//key");
            inputPanel.add("Center", inputTextField);
            inputTextField.addKeyListener(new XPathKeyListener());

            panel.add("North", inputPanel);
         }

         {  // TextArea to show query results
            queryOutput = new TextArea();
            queryOutput.setEditable(false);

            panel.add("South", queryOutput);
         }

         gbc.gridx=offset; gbc.gridy=1; gbc.gridwidth=3; gbc.gridheight=1;
         add(panel, gbc);
      }


      // Checkboxes for log levels
      gbc.gridx=0; gbc.gridy=2; gbc.gridwidth=1; gbc.gridheight=1;
      add(new Label("Choose Logging Level: "), gbc);
      gbc.gridx=1; gbc.gridwidth=3; gbc.gridheight=1;
      add(createLogLevelBoxes(), gbc);


      // Clear logging output - Button
      clearLogButton = new Button("Clear Log Window");
      class ClearListener implements ActionListener {
         public void actionPerformed(ActionEvent e) {
            logOutput.setText("");
         }
      }
      clearLogButton.addActionListener(new ClearListener());
      gbc.gridx=4; gbc.gridy=2; gbc.gridwidth=1; gbc.gridheight=1;
      gbc.weightx = gbc.weighty = 0.0;
      add(clearLogButton, gbc);


      // Dump internal state - Button
      dumpButton = new Button("Dump State");
      class DumpListener implements ActionListener {
         public void actionPerformed(ActionEvent e) {
            // logOutput.setText("");  // clear log window
            try {
               log.info("Dump start");
View Full Code Here

   }

   private void initUI() throws Exception {
      setBackground(Color.white);
      setForeground(Color.black);
      this.connectButton = new Button("Connect");
      this.connectButton.setActionCommand("connect");
      this.connectButton.addActionListener(this);
      add(this.connectButton);
      this.sendButton = new Button("Send");
      this.sendButton.setActionCommand("send");
      this.sendButton.addActionListener(this);
      add(this.sendButton);
      this.requestArea = new TextArea("", 9, 62);
      this.requestArea.setBackground(Color.white);
View Full Code Here

  setLayout(new BorderLayout());

  cntlPanel = new Panel();

  fwdButton = new Button("Forward");
  bwdButton = new Button("Backward");
  rndButton = new Button("Random");

  fwdButton.addActionListener(this);
  bwdButton.addActionListener(this);
  rndButton.addActionListener(this);
View Full Code Here

                                   GridBagConstraints c,
                                   String label,
                                   String command,
                                   Object description )
        {
            Button button = new Button( label );
            button.setActionCommand( command );
           
            c.fill = GridBagConstraints.BOTH;
            c.gridwidth = 1;
            gridBag.setConstraints( button, c );
            container.add( button );
            button.addActionListener(this);
           
            c.gridwidth = GridBagConstraints.REMAINDER;
            Component desc;
            if ( description instanceof String )
            {
View Full Code Here

    private void addLaunchButton() {

        mainPanel.invalidate();
        mainPanel.removeAll();
        launch = new Button(Messages.getString("VPNLauncher.launcher")); //$NON-NLS-1$
        launch.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                launch();
            }
        });
View Full Code Here

        // add the Cancel button to the bottom of the dialog (if allowCancel is
        // true)
        if (allowCancel) {
            Panel bottom = new Panel(new FlowLayout(FlowLayout.CENTER, 1, 1));
            cancel = new Button(Messages.getString("ProgressBar.cancel")); //$NON-NLS-1$
            cancel.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    // pbar.dispose();
                    shouldCancel = true;
                }
View Full Code Here

        OptionWrapper choice = new OptionWrapper();
        choice.idx = -1;
        for (int i = 0; choices != null && i < choices.length; i++) {
            //      ImageButton b = new ImageButton(choices[i].getIcon(), choices[i]
            //          .getText(), choices[i].getText());
            Button b = new Button(choices[i].getText()) {
                public Dimension getMinimumSize() {
                    return new Dimension(60, super.getMinimumSize().height);
                }

                public Dimension getPreferredSize() {
                    return getMinimumSize();
                }
            };
            choicePanel.add(b);
            b.addActionListener(new BlockingActionListener(choices[i]));
        }
        if (icon != null) {
            add(new ImageCanvas(icon), "West"); //$NON-NLS-1$
        }
        if(buttonBarAccessory != null) {
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.