Solved

JFileChooser

Posted on 2004-04-19
3
425 Views
Last Modified: 2008-02-01
There is a textfield that says "File name", and i want to know how to get to that file, since sometimes when i run it, it only displays the name and not the extension.


Thanks
0
Comment
Question by:DrunkenTigerDDD
3 Comments
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10857799
0
 
LVL 16

Accepted Solution

by:
krakatoa earned 50 total points
ID: 10858901
As far as I know the JFC will show you the full name of the files. Maybe you have got the extension display switched off on the OS, or the file in question just doesnt have an extension - ?
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 10859099
Correct. The File object returned will have the extension in the file-name. It might not be visible in the OS due to customized settings (in Windows, try Folder Options -> View -> Hide extensions for known filenames).
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question