-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
low
-
Applications which for some unknown reason depend on this unspecified behaviour will no longer be able to use it. This won't cause any run time exceptions etc, it would be limited to a UI rendering difference.
-
Java API
-
SE
Summary
Setting divider sizes < 0 in JSplitPane and BasicSplitPaneDivider in setDividerSize() should be ignored.
Problem
Setting the divider size to < 0 results in no divider being shown between the two components as should be done for JSplitPane components. This behavior is not specified and not intended or useful.
Solution
Update the implementation to ignore any attempt to set divider sizes < 0. Update the specification to document this new behavior.
Specification
class javax.swing.JSplitPane
/**
* Sets the size of the divider.
+ * Divider sizes {@code newSize < 0} are ignored.
*
public void setDividerSize(int newSize)
class javax.swing.plaf.basic.BasicSplitPaneDivider
/**
* Sets the size of the divider to {@code newSize}. That is
* the width if the splitpane is {@code HORIZONTAL_SPLIT}, or
* the height of {@code VERTICAL_SPLIT}.
+ * Divider sizes {@code newSize < 0} are ignored.
*
* @param newSize a new size
public void setDividerSize(int newSize) {
- csr of
-
JDK-4797982 Setting negative size of JSplitPane divider leads to unexpected results.
- Resolved