CSCI 200 Fall 2009

Laboratory 4 - Basic GUI Programming

Goal

Give you that first wonderful experience building a graphical user interface.

Grading

The lab exercise is worth 10 points. There is no design document for this assignment.

Exercise Details

Build a GUI to allow someone to create card players. Implement a class CardPlayer that can be used to create objects to represent people playing cards. CardPlayers have a name, a rating, and a favorite card game. The name and favorite card game are to be of type String. The rating is to be of type int.

You are to create a GUI that has a text field for each of the types of data mentioned above. Data entered by the user is to be stored in a TreeMap, or a HashMap. You get to choose. The name is to be the key.

You are to have a button for saving data entered by the user. You are also to have a button for listing a summary of all the user-entered data. The listing is to be done to a JTextArea.

Extra Credit - 3 points

Create a separate panel - but part of the same application - that allows the user to select a specific card player from your collection by their name. Display all the information that you have for the selected card player in the GUI window.

Use a menu to switch between the 2 panels so that only one of the panels is visible at a time.