swing 
谁做过
用actionPerformed激活另外一个frame
用 frm.setVisible(true);
显示出来,然后下面不想让他在执行了,想等在另外那个frame里面设完值在执行下面的,怎么来实现

解决方案 »

  1.   

    你说的这应该用Dialog窗口:import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JPanel;public class Test extends JFrame {
    private JPanel pane = null;
    private JButton button = null;
    private JDialog dia = null; public Test() {
    super("Test");
    pane = new JPanel();
    dia = new JDialog(this, true);
    button = new JButton("Dialog 窗口");
    pane.add(button);
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    dia.setSize(200, 100);
    dia.setVisible(true);
    }
    });
    this.getContentPane().add(pane);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setSize(300, 200);
    this.setVisible(true);
    } public static void main(String[] arg) {
    new Test();
    }}