This assignment asks you to build your first real user interface for a realistic program. In recent lectures, you learned about layout, event handling, and the various components that make up a user interface. In this assignment, you will combine all these skills to build a complete, albeit small, GUI application.
All fields are required except those explicitly labeled "optional" above. The program should have a JList that contains all songs in the database. (Note: There should be *one* single JList with all songs of all types.) Each row of the JList should be a text representation of a song in the format shown above (that is, the text examples in the "e.g."s above).
The program should allow three basic functions: (1) Add: the user can choose what type of song to enter, fill in the appropriate information, and add the song to the database; (2) Change: when the user selects a song in the list, its information is automatically filled into the fields; if the user edits these fields, the user can finalize the changes by pressing the Change button, and these changes are updated in the list; (3) Remove: the user can remove songs from the list by selecting the song and pressing a button.
All functionality must be implemented in a single frame/window. To allow the user to enter one of the three song types, you should use a JTabbedPane with 3 panes (Rock, Jazz, Classical) where each pane contains appropriate components for that song type. Then, adding a song will add the song currently visible in the tabbed pane, and selecting a song in the list will automatically change the JTabbedPane such that the correct song type is displayed (along with the correct information for that particular song). Note that the JList and the Add/Change/Remove buttons should be *outside* the tabbed pane (since they are universal, not specific to one song type).
For error checking, you should check that all required fields are not empty. However, you do not need to check the format of data within the fields (e.g., you don't need to make sure the time length is of a proper form). Also, you should not load any information from a file (or database) on startup or save the information upon quitting. (Granted, the program would not be terribly useful without this feature, but our focus is on on the GUI itself and implementing this additional functionality would not add much for our purposes.) Please ensure that the list is initially empty on startup of the program.
Besides getting the basic functionality correct, this assignment emphasizes three important aspects of GUI building. First, the data structures underlying the GUI should be implemented in a reasonable way taking advantage of proper object-oriented programming whenever possible -- for instance, you should maintain object-oriented classes for songs and song types that are separate from your main GUI frame class. Second, the window components should be laid out in a sensible, logical way that looks reasonable on-screen and allows for easy data entry. Third, the GUI should be robust in the sense that user actions work cleanly as they should and that illegal options (except for text-field error checking) are disabled whenever appropriate.
Your main class must be called "SongLogger" such that the program can be started by typing:
/* * [Your Name] * [Your-Email] * CS338:GUI, Assignment [#] */