Java Swing UIManager showDirSelect()

Here you can find the source of showDirSelect()

Description

show Dir Select

License

Apache License

Declaration

public static String showDirSelect() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.swing.JFileChooser;

import javax.swing.UIManager;

public class Main {
    public static String showDirSelect() {
        try {/*  w  ww .  j  a  va 2  s .co  m*/
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
        }
        JFileChooser chooser = new JFileChooser();
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int returnVal = chooser.showOpenDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            String path = chooser.getSelectedFile().getAbsolutePath();
            return path;
        }
        return null;
    }
}

Related

  1. setSystemUi()
  2. setTheme()
  3. setupComponent(JComponent comp)
  4. setupUI()
  5. shouldUpdateStyle(PropertyChangeEvent event)
  6. showToolTip(Component contents, int x, int y, final int dismissDelay, int initialDelay)
  7. systemLF()
  8. traceSubstanceApiUsage(Component comp, String message)
  9. useLNF()