File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes File Chooser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "File Chooser" Watch "File Chooser" New topic
Author

File Chooser

Durand Grimmett
Greenhorn

Joined: Jun 02, 2004
Posts: 16
Hello all,

Im using a File Chooser to allow users to select a directory and to name a particular jar file. However, I want to capture the name of the jarfile that they input into the textField within a string variable. Right now if I do a textFieldName.getText(); .........it will return me the entire path to the jar file. I just want the name of the jar file. I considered using the subString method, but this wouldn't be efficient in my case because the length of the path and the name of the file will most likely be different in each case. I was wondering if anyone has any suggestions in this matter? I also noticed that the FileChooser Class does contain a getName method, but this didn't work for me either. Any suggestions?

Thanks in advance,

DG
Durand Grimmett
Greenhorn

Joined: Jun 02, 2004
Posts: 16
Sorry you guys....I jumped the gun, I just figured it out.....FileChooser.getSelectedFile().getName();

Thanks anyway,

DG
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File Chooser
 
Similar Threads
jar file information
folder chooser
is there Directory Chooser in swings?
How to fetch information from a JAR file
using file chooser