| Author |
Canonical Path without an extension
|
Jacky Luk
Ranch Hand
Joined: Aug 02, 2012
Posts: 198
|
|
When I do this, the returned file name has no extension attached.
Any ideas how to fix it?
Thanks
Jack
|
 |
Ranganathan Kaliyur Mannar
Bartender
Joined: Oct 16, 2003
Posts: 915
|
|
You have to post a SSCCE. For example, the posted code doesn't have ExtensionFileFilter or chartCanvas.
Basically, we should be able to copy the posted code, compile straightaway and then we would be in a position to run and reproduce the problem in our machines. That would end in a quick resolution.
|
Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4163
|
|
Jack Luk wrote:When I do this, the returned file name has no extension attached.
Any ideas how to fix it?
String concatenation?
Also, the JDK comes with a perfectly usable FileNameExtensionFilter. Have you been reinventing the wheel?
|
luck, db
There are no new questions, but there may be new answers.
|
 |
Kemal Sokolovic
Bartender
Joined: Jun 19, 2010
Posts: 792
|
|
Why are you handling selected file as it is of type String ?
If you have JFileChooser#getSelectedFile() method that returns File, you can find out whatever you need to know about the file selected - including it's path, name with extension, etc.
|
The quieter you are, the more you are able to hear.
|
 |
 |
|
|
subject: Canonical Path without an extension
|
|
|