RT

解决方案 »

  1.   

    使用JFileChooser,查看jdkAPI关例:) JFileChooser fc = new JFileChooser();
            fc.setMultiSelectionEnabled(true);
            fc.setVisible(true);
            int state = fc.showOpenDialog(null);
            File[] files = fc.getSelectedFiles();
            if (state == JFileChooser.APPROVE_OPTION) {
              System.out.println(files.length);
            }
            else if (state == JFileChooser.CANCEL_OPTION) {
              JOptionPane.showMessageDialog(
                  null, "Canceled");
            }
            else if (state == JFileChooser.ERROR_OPTION) {
              JOptionPane.showMessageDialog(
                  null, "Error!");
            }