Procedure
This scenario will test
out the features and behavior of the Color property editor.
Setup
Create a new empty Visual Class (extending Object). Size and drop a JButton on
the free form.
Basic Functionality Inspection
Select the JButton on
the free form.
Look at the background
property on the sheet
Verify
that the color value label shows the RGB triplet
Look at the foreground
property on the sheet
Verify
that the color value label shows the named constant for a color.
Click on the background
property on the PS.
Verify
that the custom editor launcher button is displayed.
![]()
![]()
Click the editor
launcher button
Verify
the color property editor is displayed (may have to click on Java Property
Editor on taskbar)

Verify
the correct tab is shown for the given color is brought to the front. (RGB for
the RGB triplet)
Verify
the preview panel is shown.
Slide the Red slide all
the way to the right.
Verify
the color preview changes.
Click OK to dismiss the
editor.
Verify
the color change updates the canvas, source and property sheet properly.
With the background
property still selected, look to the top of the property sheet
Verify
the Restore to Default and Set to Null buttons are enabled
![]()
Click the Restore to
Default button
Verify
the JButton returns to it's default background color (204,204,204) and the
setBackground line is removed from the source.
Click the Undo button
on the toolbar
Click the Set to Null
button
Verify
the canvas changes default to the default background color (204,204,204), the
source is updated properly, and the PS shows an empty color value.
Click the Restore to
Default button again then click the property editor button again.
Change the color to a
different value.
Click the Cancel
button.
Verify
the background value does not change in the source, canvas and property sheet.
Property Editor Functionality
Inspection
Click the property
editor button to launch the editor again.
Verify
the RGB sliders and fields reflect the value of the selected color.
Verify
the color preview reflects the value of the selected color
Switch to the Named
Colors tab. The rest of the tabs are provided by Sun, so there's not much point
in testing them out as we can't do much to fix any problems.
Verify
the basic color list contains the following values: black, blue, cyan, darkGray,
gray, green, lightGray, magenta, orange, pink, red, white, yellow
Verify
the system color list contains the constant values from the SystemColor class
Verify
the both lists are sorted alphabetically.
Verify
that color swatches are displayed next to the color titles.
Choose a color from the
basic color list.
Verify
the preview pane color to reflect the new color.
Switch to the RGB tab.
Verify the sliders and
RGB fields reflect the new color's RGB value.
Switch back to the
Named Colors tab.
Choose a color from the
System color list.
Verify
the preview pane color to reflect the new color.
Verify
the previously selected basic color becomes unselected.
Switch to the RGB tab.
Verify the sliders and
RGB fields reflect the new color's RGB value.
Use the sliders on the
RGB tab to adjust the value to 0,0,0.
Switch to the Named
Colors tab
Verify
the previously selected system color becomes unselected.
Verify
the basic color black is selected.
Switch to the RGB tab.
Use the sliders on the
RGB tab to adjust the value to 255,255,0.
Switch to the Named
Colors tab
Verify
the basic color yellow is selected and the list scrolled properly.
Source Code
Hit OK to dismiss the
editor
Verify
the color change on the canvas, source and property sheet.
Verify
the source code reflects the correct named color ( java.awt.Color.yellow )
Change the text in the
source to java.awt.Color.blue
Verify
the color change on the canvas, source and property sheet.
Click off the JButton
to the free form, then select the JButton again. (refreshing the property sheet)
Select the background
property and bring the color property editor again.
Verify
the Named Colors tab is in the front.
Verify
blue is selected on the basic colors list.
Choose the color "info"
from the System Colors list.
Verify
blue remains as the previous color in the preview panel

Hit OK to dismiss the
editor
Verify
the color change on the canvas, source and property sheet.
Verify
the source code reflects the correct named color ( java.awt.SystemColor.info )
Change the text in the
source to java.awt.System.desktop
Verify
the color change on the canvas, source and property sheet.
Bring up the color
editor again, select any color from the tabs other than Named Colors and hit OK.
Verify
the color change on the canvas, source and property sheet.
Verify
the source code reflects the correct rgb constructor.
Change the RGB value in
the source
Verify
the color change on the canvas and property sheet.
Try the other Color
constructors from the source:
new
java.awt.Color(0.25F,0.5F,0.75F)
new
java.awt.Color(0.25F,0.5F,0.75F,0.5F)
new
java.awt.Color(9999999)
new
java.awt.Color(987654321,true)
new
java.awt.Color(100,200,30,128)
Verify
each constructor updates the canvas and property sheet correctly.