★★Java質問・相談スレッド156★★
■ このスレッドは過去ログ倉庫に格納されています
0145デフォルトの名無しさん
2012/08/14(火) 22:49:00.14private JLabel label;
private JTextField field;
private JButton button1;
public WinApp(){
this.setSize(new Dimension(300, 300));
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
label = new JLabel("This is Sample");
this.add(label, BorderLayout.NORTH);
field = new JTextField();
this.add(field, BorderLayout.CENTER);
button1 = new JButton("CLICK");
button1.addActionListener(this);
this.add(button1, BorderLayout.SOUTH);
}
public void actionPerformed(ActionEvent ae){
if(ae.getActionCommand() == "CLICK"){
//System.out.println("button event");
}
}
public static void main(String[] args) {
new WinApp().setVisible(true);
}
}
■ このスレッドは過去ログ倉庫に格納されています