United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6932524 NIMBUS: 3 constructors of JSplitPane creates new jsp with continuous layout - they should not.
JDK-6932524 : NIMBUS: 3 constructors of JSplitPane creates new jsp with continuous layout - they should not.

Details
Type:
Bug
Submit Date:
2010-03-05
Status:
Resolved
Updated Date:
2012-03-22
Project Name:
JDK
Resolved Date:
2010-04-14
Component:
client-libs
OS:
generic
Sub-Component:
javax.swing
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:

Related Reports
Backport:
Backport:
Duplicate:
Relates:
Relates:

Sub Tasks

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

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.
                                     
2010-03-17
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
                                     
2010-03-29



Hardware and Software, Engineered to Work Together