HW10 - rating. Add the pictures using the JLabel component...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ENGR131 – Homework 10: Graphical User Interfaces Due at 11:59 PM on Tuesday November 27, 2007. Submit your .java files as required by your TA. Grading: Problem 1 (45 pts). Problem 2 (45 pts). General (10 pts). Instructions: The goal of this assignment is to write GUI programs that use several of the programming techniques you have used in the past. User input is handled differently in each problem. Problem #1 is just a sequential program that uses input dialogs to get user input. Once the final JFrame is displayed, there is no more user interaction. In contrast, problem #2 is an event-driven program that uses certain GUI components in the JFrame to get user input. As such, the user can continuously interact with the program. 1. Write a program that displays the user’s ratings of a list of items using pictures in a bar graph format. Use input dialogs to get the number of items and the user’s numerical rating for each. Use a GridLayout such that the item names appear on the far left column and there are enough columns for the maximum possible
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: rating. Add the pictures using the JLabel component (section 12.10), being careful to add empty labels where necessary. Choose any items and picture you wish (available formats are listed in section 12.10). The following is an example of screens based on ratings from movies.aol.com (do not use this): 2. Write a program that displays a picture chosen by the user. Use a JTextField for the file name, a JButton to generate an event, and a JLabel to display either the picture or a message if the file does not exist (see section 8.8 and associated lectures). Use a FlowLayout so as not to restrict the image size (see section 12.5.1). Display the message No image in the label when the program begins. The exact arrangement of the components is not important and may vary depending on the image size. The following screen shots show the initial window appearance and two possible results after the user has entered a file name and clicked the Open button....
View Full Document

Page1 / 2

HW10 - rating. Add the pictures using the JLabel component...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online