Package java.awt

Examples of java.awt.Button.addActionListener()


   
    Button push_button = new Button("push");
    push_button.addActionListener(new pushListener(s, this));
    this.add(push_button);
    Button pop_button = new Button("pop");
    pop_button.addActionListener(new popListener(s, this));
    this.add(pop_button);
   
    Button lock_button = new Button("print");
    lock_button.addActionListener(new printListener(s, this));
    this.add(lock_button);
View Full Code Here


    Button pop_button = new Button("pop");
    pop_button.addActionListener(new popListener(s, this));
    this.add(pop_button);
   
    Button lock_button = new Button("print");
    lock_button.addActionListener(new printListener(s, this));
    this.add(lock_button);
   
    this.setSize(500, 300);
    this.setResizable(false);
    this.text.setBackground(Color.black);
View Full Code Here

      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

      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);
View Full Code Here

      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());
View Full Code Here

      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

         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;
View Full Code Here

         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;
View Full Code Here

         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

        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

TOP
Copyright © 2018 www.massapi.com. 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.