0

I'm starting to build a JFrame application to work with File Handling. What I'm trying to get done from the application is that

  1. it reads the contents of all the texts files in a particular location and merges the contents & creates one single text file.
  2. The main property this application should have is that it should not have the navigate-to-location feature. Suppose if I paste this application in location C:\Users\Desktop\application.exe, the application must search the location for all the text files (i.e. on Desktop) & merge them into one single text file.

I've observed this in patch tools to patch softwares, they never ask for location for the software's_launcher.exe, they just tell us to paste the patch in the directory where the launcher belongs.

How do they do it? How can I do the same for my own application?

Master
  • 2,945
  • 5
  • 34
  • 65
Siddharth Thevaril
  • 3,722
  • 3
  • 35
  • 71
  • [Getting the Current Working Directory in Java](http://stackoverflow.com/questions/4871051/getting-the-current-working-directory-in-java) – Robert Harvey Sep 03 '13 at 16:38

1 Answers1

1

"./" is to specify current directory.

if you use

File f1 = new File("./"); 

then f1 is reference of current directory.

if your application is at C:\Users\Desktop\application.exe place then all files & folder at C:\Users\Desktop can access by "./" string

Pulah Nandha
  • 774
  • 4
  • 23