All About Class Button in AWT in Java

0
146
Spread the love
  • 29
  • 34
  • 28
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    138
    Shares

Class Button in Java
Class Button in AWT in Java
Class Button in Java

Class Button in Java:

This class Button is responsible for creating a labeled or unlabeled button in the GUI.We need to use setActionCommand() that specify an String to identify which button has generated the ActionEvent.

The structure of the class Button is given as :


public class java.awt.Button extends java.awt.Component{
//constructors
public Button();//creates an button without a label in it
public Button(String Label);//creates a button with the label -Label
//methods:
public void setLabel(String label);//sets a label for the button.
public void addNotify();
public String getLabel();
public synchronized void setLabel(String label);
public synchronized void addActionListener(ActionListener l);
public synchronized void removeActionListener(ActionListener l);
public String getActionCommand();
public void setActionCommand(String command);
protected String paramString();
protected void processActionEvent(ActionEvent e);
protected void processEvent(AWTEvent e);
}
 
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 29
  • 34
  • 28
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    138
    Shares

LEAVE A REPLY

Please enter your comment!
Please enter your name here