import javax.swing.*;
class ButtonWIthAction extends JFrame{
JLabel label = new JLabel("this will be change");
JButton button = new JButton("Show your name");
JPanel panel = new JPanel();
public ButtonWIthAction(){
this.setTitle("Test Action");
this.setSize(200,200);
this.setLocationRelativeTo(null);
//this.setLocation(500,20);
this.setVisible(true);
}
public void settingGui(){
panel.add(label);
panel.add(button);
this.add(panel);
}
public static void main(String[] args){
ButtonWIthAction bwa = new ButtonWIthAction();
bwa.settingGui();
}
}
this maybe can help you :
No comments:
Post a Comment