My Color Chooser
Posted on 2003-12-03
I have been trying to teach myself java. I have been using the Deitel & Deitel book Java How to Program, 5th Edition. Does anyone know where I can find the solutions to the problems at the end of the chapters? I wish I could look at the finished examples. Anyway, I have been trying to do problem 14.12 and need to know how to do it. Here is the question:
Declare a subclass of JPanel called MyColorChooser that provides three JSlider objects and three JTextField objects. Each JSlider represents the values from 0-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 JSlider, the JTextField should be changed accordingly. Declare class MyColorChooser so it can be reused in other applications or applets. Use your new GUI component as part of an applet that displays the current Color value by drawing a filled rectangle.