java - Hide the path of the selected directory in JFileChooser -


i'm using jfilechooser select directories, set selection mode directories_only, problem when select directory, absolute path displayed in text field in below picture:

enter image description here

is there way display name of directory, in file selection mode?

this code:

import javax.swing.jfilechooser;  public class myform {       public static void main(string[] args) {          jfilechooser chooser = new jfilechooser();         chooser.setcurrentdirectory(new java.io.file("./"));         chooser.setdialogtitle("select directory");         chooser.setfileselectionmode(jfilechooser.directories_only);         chooser.setacceptallfilefilterused(false);          if (chooser.showopendialog(null) == jfilechooser.approve_option) {             system.out.println(chooser.getselectedfile().getabsolutepath());                     }            } } 


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -