- 228 名前:デフォルトの名無しさん [2007/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); } } }
|

|