Java標準低速GUI 6 AW ..
228:デフォルトの名無しさん
07/11/01 22:34:06
これなんですがまったく出来ません。
public class Practice extends JFrame implements ActionListener{
Button btnEnter;
public static void main(String[] args){
Practice frame = new Practice();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(50, 50, 900, 700);
frame.setTitle("研究のGUI");
frame.setVisible(true);
}
Practice(){
JPanel p = new JPanel();
btnEnter = new Button("追加");
btnEnter.addActionListener(this);
add(btnEnter);
btnEnter.setBounds(250,120,80,80);
getContentPane().add(p, BorderLayout.CENTER);
appRun();
}
public void appRun(){
}
public void actionPerformed(ActionEvent e){
Button bt = (Button)e.getSource();
if(bt==btnEnter){
JLabel Ac1 = new JLabel();
Ac1.setBounds(400,100,80,30);
Ac1.setText("Push");
add(Ac1);
}
}
}
次ページ最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4901日前に更新/252 KB
担当:undef