![]() |
![]() |
Now that you have added the new buttons, the next step is to add file dialog beans for opening files and saving files. Later, you will use these file dialog beans to obtain a file selection and provide parameters to the readToDoFile and writeToDoFile methods.
These file dialog beans are preview beans for Swing that are not part of the Java Foundation Classes. Note that the Java Foundation Classes (JFC) present these file dialogs in a platform-independent representation as shown below:
In the finished To-Do List program, a file dialog appears when a user selects the Open To-Do File or Save To-Do File button. In the file dialogs, the user specifies the name of the file to open or save.
To add the file dialog beans:
Your free-form surface should look similar to the one below.
Save the current state of your work in the Visual Composition Editor by selecting Save Bean from the Bean menu.
Note:
The exact positions of the file dialog beans do not affect the interface of the finished
program. However, it will be easier for you to follow the instructions in the following
sections for connecting beans if you line up these beans according to the instructions in
this section.
![]() |
![]() |