This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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,
Joined: Jun 02, 2004
Sorry you guys....I jumped the gun, I just figured it out.....FileChooser.getSelectedFile().getName();