- 704 名前:11 mailto:sage [2008/02/24(日) 12:31:27 ]
- 画面A,B,Cとあり画面CのB画面終了ボタンを押すとB画面のみ終了させたいと考えてますが
さっぱりわかりません。どなたかご教授願います。 /*ソースここから*/ import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Gamen extends JFrame implements ActionListener{ private JButton b1 = new JButton("B画面表示"); private JButton b2 = new JButton("終了"); private JButton b3 = new JButton("C画面表示"); private JButton b4 = new JButton("B画面終了"); public void GamenA() { getContentPane().setLayout(new FlowLayout()); getContentPane().add(b1); getContentPane().add(b2); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setTitle("A画面"); setSize(200, 100); setVisible(true); b1.addActionListener(this); b2.addActionListener(this);} public void GamenB() { getContentPane().setLayout(new FlowLayout()); getContentPane().add(b3); getContentPane().add(b2); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setTitle("B画面"); setSize(200, 100); setVisible(true); b3.addActionListener(this); b2.addActionListener(this);} //続きます
|

|