Part 3 - Window for Editing Product Information
Now it's time to learn the basics of handling multiple windows. Make a window for editing product information. An example is shown in the figure 3-1.
A user should be able to select the supplier from a combo box. It could be useful to check out the Product class once again for helpful methods.
The editing window (modal dialog) should appear when pressing the Change Product Info -button. The information of the selected product should be shown in the editing window, as you can see from the example. You should be able to figure out the proper functionality for the Change- and Cancel-buttons.
You don't need to save the data in a file or anything like that, but the application should remember the product information as long as it's running. Remember to implement the refreshing of the text area after the editing.
Note that closing the editing window closes only the editing window, but closing the main window closes the whole application.
Grading
Ceilidh will look especially following topics
- Editing the information, Change-button functionality
- Refreshing the text area
- Closing the windows, Cancel-button functionality
- Layout of the dialog
Get information on these
- Sending messages between windows/components/objects
- JComboBox
- JTextField
- JDialog. Don't get bogged down with this one. If you can use a JFrame, you can use a JDialog. Java API is a good source of information.
Figure 3-1. Window for editing the product information.Other parts
Part 1 - The Main Window
Part 2 - Product Information and Event-Handling
Part 4. Menus and Confirmations
Part 5. Feedback questionnaire (compulsory)