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.