473,320 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

4
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
Sep 25 '09 #1
1 2030
r035198x
13,262 8TB
Cross posted in other forums.
Sep 25 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: EAS | last post by:
Does anyone know how to display the current directory using DOS and/or Python? I already tried os.pardir and os.curdir in Python, but all they return are a couple of periods... >>>import os...
4
by: Jon Rea | last post by:
Hi, Just a quickie ... I thought that Directory.GetCurrentGirectory(), unless the current directory had been changed by the program, would always point to the directory where the .exe for the...
3
by: PHaroZ | last post by:
Hi, I want to retrieve the complete full path to the directory of my current page but i don't find how to do that. For example i want : D:\myWebSite\firstDotNetWebApp\dir1\ I tried...
3
by: Badass Scotsman | last post by:
Hello, I would like to display the current directory which an ASPX file sits within, and display the result on page. For example: www.test.com/hello/test.aspx would return:...
3
by: Chris Mellon | last post by:
This appears to be a change in behavior from Python 2.4 to Python 2.5, which I can't find documented anywhere. It may be windows only, or related to Windows behavior. In 2.4, the current...
14
by: gio | last post by:
I have a problem and the solution should works under windows and unix OS. Suppose I have a program ex.c in the directory X (so the current working directory of ex.c is X). Also suppose I have...
6
by: titan.nyquist | last post by:
The WebBrowser control won't load a css file written in the same directory as the program. If I put an absolute path to it, it will load it. Thus, the current directory of the WebBrowser control...
11
by: greg | last post by:
Hi all, Is there a way to get the current theme name at design time? I'm trying to write a custom control for which I need to use images from the current theme. I have asigned a theme to the...
5
by: pradeep84 | last post by:
Hi.. to all... in the following program i hav retrived data from the database and stored in the string s2,s3... now i hav display the following string in the textfields... i dont know how.. to do...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.