Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Online Training

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
Print Button
 

Help is available for each task.



    Task 1

    Create a Frame to use as a parent and then create a FileDialog attached to that frame with a title of "Open". Show the file dialog. The current thread will block (unlike a pure Dialog object). Print to standard output the filename you typed in or selected--handle a null value gracefully. Do not forget to dispose of the frame you created.


    While selecting a file from the list works, unfortunately, typing in a file name that does not exist does not work. The file dialog leaves the ".*.*" on the end of your filename. Try typing in "foo" and the file dialog will give you an error. Be aware of this idiosyncrasy. With some platforms, FileDialog reports that the file does not exist before you can see it in Java and requires the user to enter another name or to select 'Cancel'.

Copyright 1996-2000 jGuru.com. All Rights Reserved.


Print Button
[ This page was updated: 14-Jul-2000 ]
Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-2000 Sun Microsystems, Inc.
All Rights Reserved. Terms of Use. Privacy Policy.