JDK-6932524 : NIMBUS: 3 constructors of JSplitPane creates new jsp with continuous layout - they should not.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-03-05
  • Updated: 2012-03-22
  • Resolved: 2010-04-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u21Resolved 7 b89Fixed OpenJDK6Fixed
Related Reports
Duplicate :  
Relates :  
Description
Consider this small program:
import java.awt.*;
import javax.swing.*;

public class test {
    public static void main(String argv[]) {
        JSplitPane c;

	c = new JSplitPane(SwingConstants.VERTICAL);
	System.out.println(c.isContinuousLayout());

	c = new JSplitPane(SwingConstants.HORIZONTAL);
	System.out.println(c.isContinuousLayout());

	Canvas cv = new Canvas();
        JButton bt = new JButton();

	c = new JSplitPane(SwingConstants.VERTICAL, cv, bt);
	System.out.println(c.isContinuousLayout());

	c = new JSplitPane(SwingConstants.HORIZONTAL, cv, bt);
	System.out.println(c.isContinuousLayout());
    }
}

When run with nimbus l&f it gives wrong results:
[..]$ /export/jdk/jdk1.6.0_18/bin/java -cp . -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel test
true
true
true
true
[..]$ /export/jdk/jdk1.6.0_18/bin/java -cp . test
false
false
false
false

According to http://java.sun.com/javase/6/docs/api/javax/swing/JSplitPane.html
JSplitPane() - 
          Creates a new JSplitPane configured to arrange the child components side-by-side horizontally with no continuous layout, using two buttons for the components.

JSplitPane(int newOrientation)
          Creates a new JSplitPane configured with the specified orientation and no continuous layout.

JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)
          Creates a new JSplitPane with the specified orientation and with the specified components that do not do continuous redrawing.

Comments
EVALUATION It was decided not to fix this CR in JDK 6 and roll it back from JDK 7, please see 6937415 for more details
29-03-2010

EVALUATION JSplitPane ctors read SplitPane.continuousLayout UI property which is defined in Nimbus only. This violates the specification which mandates that continuous layout should not be used.
17-03-2010