JDK-4668513 : Swing BorderFactory.createBevelBorder() spec doesn't completely specify behavior
  • Type: Bug
  • Component: docs
  • Sub-Component: guides
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2002-04-15
  • Updated: 2003-01-27
  • Resolved: 2003-01-27
Related Reports
Duplicate :  
Description
In Merlin, the spec for 
javax.swing.BorderFactory.createBevelBorder(int,Color,Color,Color,Color)
says:
  Creates a beveled border of the specified type, using the specified colors 
  for the inner and outer highlight and shadow areas. 

This method is under-specified.

The spec should specify that the inner and outer shadow colors are
switched, depending on whether the border is lowered or not.


Example:
Create a button with a beveled border that has the following
characteristics:
  shadow outer: red
  shadow inner: blue
ie:
  jl = new JLabel("BorderTester");  
  jl.setBorder(BorderFactory.createBevelBorder(raisedInt, Color.WHITE, Color.BLACK, Color.red, Color.blue));

The following behavior is observed in this situation:
When the border is raised:
  shadowInner=blue 
  shadowOuter=red

When the border is lowered:
  shadowInner=red 
  shadowOuter=blue


The following JCK 1.4 test fails due to this bug:
api/javax_swing/interactive/BorderFactoryTests.html#BorderFactory[BorderFactoryTest0003]

To run this test, run the attached script (jdkjck) as follows:
jdkjck -jdk:/java/re/jdk/1.4/archive/fcs/binaries/solsparc -jck:/java/re/jck/1.4/archive/fcs/binaries/JCK-runtime-14 -runtime api/javax_swing/interactive/BorderFactoryTests.html

Comments
EVALUATION Closing as a duplicate of 4664885. ###@###.### 2003-01-27
27-01-2003