Connecting Tech Pros Worldwide Help | Site Map

how to get the current path of the directory and it will display on the textfield.?

Newbie
 
Join Date: Sep 2009
Posts: 4
#1: Sep 25 '09
hello...

how to get the current path of the directory and it will display on the textfield...
this is my codes:

Expand|Select|Wrap|Line Numbers
  1.  private void BrowseDirActionPerformed(java.awt.event.ActionEvent evt) {
  2.         // TODO add your handling code here:
  3.         JFileChooser JFileChooseDir = new JFileChooser();
  4.         JFileChooseDir.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  5.         int result = JFileChooseDir.showDialog(this, "Open/Save");
  6.         if (result == JFileChooser.APPROVE_OPTION) {
  7.                 File file2 = JFileChooseDir.getCurrentDirectory();
  8.         if (file2.isDirectory()){
  9.                 System.getProperty("user.dir");
  10.                 TxtFldDir.setText(file2.getPath());
  11.             }
  12.                 }
  13.     }
  14.  
i need answer asap...

thanks for your help
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Sep 25 '09

re: how to get the current path of the directory and it will display on the textfield.?


Cross posted in other forums.
Reply