Package java.awt

Examples of java.awt.Button


          fRun.setEnabled(fSuiteField.getText().length() > 0);
          fStatusLine.setText("");
        }
      }
    );
    fRun= new Button("Run");
    fRun.setEnabled(false);
    fRun.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          runSuite();
        }
      }
    );
    boolean useLoader= useReloadingTestSuiteLoader();
    fUseLoadingRunner= new Checkbox("Reload classes every run", useLoader);
    if (inVAJava())
      fUseLoadingRunner.setVisible(false);

    //---- second section
    fProgressIndicator= new ProgressBar();

    //---- third section
    fNumberOfErrors= new Label("0000", Label.RIGHT);
    fNumberOfErrors.setText("0");
    fNumberOfErrors.setFont(PLAIN_FONT);

    fNumberOfFailures= new Label("0000", Label.RIGHT);
    fNumberOfFailures.setText("0");
    fNumberOfFailures.setFont(PLAIN_FONT);

    fNumberOfRuns= new Label("0000", Label.RIGHT);
    fNumberOfRuns.setText("0");
    fNumberOfRuns.setFont(PLAIN_FONT);

    Panel numbersPanel= createCounterPanel();

    //---- fourth section
    Label failureLabel= new Label("Errors and Failures:");

    fFailureList= new List(5);
    fFailureList.addItemListener(
      new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          failureSelected();
        }
      }
    );
    fRerunButton= new Button("Run");
    fRerunButton.setEnabled(false);
    fRerunButton.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          rerun();
        }
      }
    );

    Panel failedPanel= new Panel(new GridLayout(0, 1, 0, 2));
    failedPanel.add(fRerunButton);

    fTraceArea= new TextArea();
    fTraceArea.setRows(5);
    fTraceArea.setColumns(60);

    //---- fifth section
    fStatusLine= new TextField();
    fStatusLine.setFont(PLAIN_FONT);
    fStatusLine.setEditable(false);
    fStatusLine.setForeground(Color.red);

    fQuitButton= new Button("Exit");
    fQuitButton.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          System.exit(0);
        }
View Full Code Here


  frame_1_grid.columnWeights = frame_1_columnWeights;

  frame_1 = new Panel();
  this.add(frame_1);
 
  ok = new Button();
  ok.setLabel("OK");
  frame_1.add(ok);
 
  title = new Label();
  title.setFont(new Font("Helvetica",Font.PLAIN + Font.BOLD , 18));
  title.setText(message);
  title.setAlignment(Label.CENTER);
  this.add(title);
 
  cancel = new Button();
  cancel.setLabel("Cancel");
  frame_1.add(cancel);
 
  // Geometry management
  GridBagConstraints con = new GridBagConstraints();
View Full Code Here

      Panel center = new Panel();
      center.add(new Label(message));

      // Create a panel for the 'OK' button
      Panel bottom = new Panel();
      Button okButton = new Button("   OK   ");
      okButton.addActionListener(new ButtonHandler());
      bottom.add(okButton);
     
      // Add the two panels to the window/frame
      add(center, BorderLayout.CENTER);
      add(bottom,BorderLayout.SOUTH);
View Full Code Here

      add(new Panel(), constr);

      constr.gridwidth = 1;
      constr.anchor = GridBagConstraints.CENTER;
      constr.weightx = 1.0;
      add(default_focus = new Button("Accept"), constr);
      default_focus.addActionListener(new Accept());

      Button b;
      constr.gridwidth = GridBagConstraints.REMAINDER;
      add(b = new Button("Reject"), constr);
      b.addActionListener(new Reject());

      constr.weightx = 0.0;
      p = new Separator();
      constr.fill = GridBagConstraints.HORIZONTAL;
      add(p, constr);

      constr.fill = GridBagConstraints.NONE;
      constr.anchor = GridBagConstraints.WEST;
      add(new Label("Accept/Reject all cookies from a host or domain:"), constr);

      p = new Panel();
      p.add(new Label("Host/Domain:"));
      p.add(domain = new TextField(30));
      add(p, constr);

      add(new Label("domains are characterized by a leading dot (`.');"), constr);
      add(new Label("an empty string matches all hosts"), constr);

      constr.anchor = GridBagConstraints.CENTER;
      constr.gridwidth = 1;
      constr.weightx = 1.0;
      add(b = new Button("Accept All"), constr);
      b.addActionListener(new AcceptDomain());

      constr.gridwidth = GridBagConstraints.REMAINDER;
      add(b = new Button("Reject All"), constr);
      b.addActionListener(new RejectDomain());

      pack();

      constr.anchor = GridBagConstraints.WEST;
      constr.gridwidth = GridBagConstraints.REMAINDER;
View Full Code Here

         p.add(pp);
         constr.gridwidth = GridBagConstraints.REMAINDER;
         gb.setConstraints(pp, constr);
         constr.gridwidth = 1;
         constr.weightx = 1.0;
         Button b;
         p.add(b = new Button("  OK  "));
         b.addActionListener(new Ok());
         constr.weightx = 1.0;
         gb.setConstraints(b, constr);
         p.add(b = new Button("Clear"));
         b.addActionListener(new Clear());
         constr.weightx = 2.0;
         gb.setConstraints(b, constr);
         p.add(b = new Button("Cancel"));
         b.addActionListener(new Cancel());
         constr.weightx = 1.0;
         gb.setConstraints(b, constr);
         add("South", p);

         pack();
View Full Code Here

import junit.framework.TestCase;

public class MouseEventTest extends TestCase {

    public final void testMouseEventComponentintlongintintintintboolean() {
        Button button = new Button("Button");
        MouseEvent event = new MouseEvent(button, MouseEvent.MOUSE_PRESSED, 1000000000,
                InputEvent.BUTTON2_DOWN_MASK, 100, 200,
                10, true);

        assertEquals(event.getSource(), button);
View Full Code Here

        assertEquals(event.getY(), 200);
        assertTrue(event.isPopupTrigger());
    }

    public final void testMouseEventComponentintlongintintintintbooleanint() {
        Button button = new Button("Button");
        MouseEvent event = new MouseEvent(button, MouseEvent.MOUSE_PRESSED, 1000000000,
                InputEvent.BUTTON2_DOWN_MASK, 100, 200,
                10, true, MouseEvent.BUTTON1);

        assertEquals(event.getSource(), button);
View Full Code Here

        assertEquals(event.getY(), 200);
        assertTrue(event.isPopupTrigger());
    }

    public final void testTranslatePoint() {
        Button button = new Button("Button");
        MouseEvent event = new MouseEvent(button, MouseEvent.MOUSE_PRESSED, 1000000000,
                InputEvent.BUTTON2_DOWN_MASK, 100, 200,
                10, true);

        event.translatePoint(10, 10);
View Full Code Here

@SuppressWarnings("serial")
public class InputEventTest extends TestCase {

    public final void testInputEvent() {
        Button button = new Button("Button");
        InputEvent event = new InputEvent(button, 0, 1000000000,
                InputEvent.ALT_DOWN_MASK | InputEvent.BUTTON1_MASK) {};

        assertEquals(event.getSource(), button);
        assertEquals(event.getID(), 0);
View Full Code Here

        assertEquals(event.getWhen(), 1000000000);
        assertEquals(event.getModifiers(), InputEvent.ALT_MASK | InputEvent.BUTTON1_MASK);
    }

    public final void testConsuming() {
        Button button = new Button("Button");
        InputEvent event = new InputEvent(button, 0, 1000000000,
                InputEvent.ALT_DOWN_MASK | InputEvent.BUTTON1_MASK) {};

        assertFalse(event.isConsumed());
        event.consume();
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.