确定按钮是用
JOptionPane examPane = new JOptionPane();
examPane.showMessageDialog(MainFrame.this,"导入成功");
做的,但不知道怎么给添加监听器

解决方案 »

  1.   

    实现监听接口
    class xxxx extends ActionLister{public void actionPerformed(ActionEvent e) {
      .......具体处理
    }}添加监听
    new JButton("确定").addActionListener(new MyAction());好像是这个样子啊
      

  2.   

    JButton butt = new JButton("button");
    butt.addActionListener(new ActionListener(){
       public void actionPerformed(ActionEvent ae) {
          //...
       }
    });
      

  3.   

    JOptionPane examPane = new JOptionPane();
    examPane.showMessageDialog(MainFrame.this,"导入成功");
    这是用 JOptionPane 中的一个方法实现的,弹出信息框
    所以不知道怎么弄
      

  4.   

    new ActionListener()
    再实现他的方法