Hi there,

    You can use the setSelectedFile(File objFile); method prior to
calling the showDialog method on the JFileChooser object. You may try
the attached program.
    Complie it and then run it giving the absolute path of some file,
like
    java TestJChooser c:\mydirectory\somefilename



Neil Thorne wrote:

> Hi,
> I would like to have the following functionality when using JFileChooser.
> When the JFileChooser is shown to the user, I'd like to be able to control
> the initial file name that gets populated in the file name textfield. Does
> any one know how to achieve this?
> Thanks a lot.
> Neil
>
> Neil Thorne
> Java Developer
> Kinetech Europe
> 0207 200 7856
>
> **********************************************************************
> This email is intended only for the addressee. This email
> and any files transmitted with it may contain confidential
> or privileged information. If you are not the named
> addressee or the person responsible for delivering the
> message to the named addressee, please contact
> [EMAIL PROTECTED]
>
> This email has been scanned by MAILsweeper.
> **********************************************************************
> _______________________________________________
> Swing mailing list
> [EMAIL PROTECTED]
> http://eos.dk/mailman/listinfo/swing

_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to