FileChooser | JavaFX GUI Tutorial for Beginners

Опубликовано: 15 Октябрь 2024
на канале: Java Code Junkie
8,156
107

In this JavaFX GUI tutorial for Beginners we will learn how to use the FileChooser Dialog.

FileChooser provides support for standard platform file dialogs. These dialogs have look and feel of the platform UI components which is independent of JavaFX.

A FileChooser can be used to invoke file open dialogs for selecting single file (showOpenDialog), file open dialogs for selecting multiple files (showOpenMultipleDialog) and file save dialogs (showSaveDialog). The configuration of the displayed dialog is controlled by the values of the FileChooser properties set before the corresponding show*Dialog method is called. This configuration includes the dialog's title, the initial directory displayed in the dialog and the extension filter(s) for the listed files. A call to a show dialog method is blocked until the user makes a choice or cancels the dialog. The return value specifies the selected file(s) or equals to null if the dialog has been canceled.

Eclipse Project code is available on GitHub
https://github.com/JavaCodeJunkie

Check out my YouTube Channel for more FREE videos
   / javacodejunkie  

Do you want to learn more about Java and how you can grow your skills as a Java Developer? SUBSCRIBE and ring that bell!