import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class MFrame extends JFrame{
JButton btn;
//hBox used to add cmp
Box hBox ;
public MFrame(){
setup();
mbind();
}
public void mbind(){
}
public void setup(){
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
super.setBounds(0, 0, 500, 500);
btn=new JButton("Exit");
btn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
System.exit(0);
}
});
hBox=Box.createHorizontalBox();
hBox.add(this.btn);
super.add(hBox);
}
public void s(){
super.setVisible(true);
}
public void madd(Component cmp){
this.hBox.add(cmp);
}
public static void main(String[] args) {
MFrame mf=new MFrame();
mf.s();
}
}
/*
if (e.isActionKey()) {
int modifiersEx = e.getModifiersEx();
String modString = "extended modifiers = " + modifiersEx;
String tmpString = KeyEvent.getModifiersExText(modifiersEx);
int keyCode = e.getKeyCode();
*/