“打开”菜单项中JFileChooser中的“打开”和“取消”按纽怎么实现?谢谢了

解决方案 »

  1.   

    openItem.addActionListener(new ActionListener(){
       public void actionPerformed(ActionEvent event){
            fileChooser.showOpenDialog(this);
       }
    });
      

  2.   

    是用来提醒的那个吗?还是个Botton?
      

  3.   

                    JFileChooser fileChooser=new JFileChooser();
                   fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
                   int result =fileChooser.showSaveDialog(this);
                   if(result==JFileChooser.CANCEL_OPTION)
                            return ;
      

  4.   

    那个是在JFrame添加JMenuBar 再添加JMenu 再添加JMenuItem