Simulate downloading songs from a website. A user has $100 in credit and can download songs at 10 cents per download (simulated). The system has a hard-coded set of songs and users; see the base code for all user and song values. A snapshot of the initial screen is shown below; your system should be as close to the GUI as possible. A full set of snapshots is given in UTSOnline/Assignments/2/snaps.
The user enters an (integer) id and (string) password and clicks on the Find button. If successful, the id and password are cleared and the user name and balance are shown in the status field below the button; if the id or password is wrong, the status field shows an error message. Any click on the Find button clears the list of user songs (initially empty). See image.
After logging in, the user clicks on a song (at right) and that song is added to the user's bought songs (after charging $0.10), shown at bottom left; only the song name is shown. The list of songs is scrollable. The new user balance is also shown in the status field.
The window appears at location (0, 500). I used a BorderLayout for the system panel. Vertical struts are of size 10 or 20, and horizontal struts are of size 5. A table column is 120 pixels wide.