{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


Week15_Assignment - Note It is ok to use the JSlider...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Assignment for Chapter 25 Write a color chooser program containing three Scrollbar objects and three TextField objects. Each Scrollbar represents the values from 0 to 255 for the red, green and blue parts of a color. Use the red, green and blue values as the arguments to the Color constructor to create a new Color object. Display the current value of each Scrollbar in the corresponding TextField . When the user changes the value of the Scrollbar , the TextField should be changed accordingly. Display the current Color value. This could be done by adding a panel, and manipulating it’s color, or by changing the background color of your applet area.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Note: It is ok to use the JSlider components of Swing for this exercise instead of Scrollbar ’s. Extra Credit: Modify the above program to allow the user to type an integer value into a TextField to set the red, green or blue value. When the user presses Enter in the TextField , the corresponding Scrollbar should be set to the appropriate value. Also, manipulate the color of the individual scrollbars, making them individually display their proportional shades of red, green, and blue. Date Due At 5PM, the last day of scheduled classes (check the bottom of your syllabus). No assignments will be accepted after this date....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online