setDividerSize
setDividerSize is a method provided by several user interface component classes in the Java Foundation Classes (JFC), most notably in the javax.swing.JSplitPane class. It allows developers to specify the pixel width of the draggable divider that separates the two child components of a split pane. The method signature in JSplitPane is public void setDividerSize(int newSize). The argument specifies the desired size of the divider in screen pixels. A value of 0 effectively removes the divider, making the split pane appear as a single component, while larger values increase the visual prominence of the divider. The method accepts negative values, which are treated as zero, ensuring that the divider size cannot become negative. The divider size can also be queried via the complementary getDividerSize method. In addition to JSplitPane, the utility method is available on certain subclasses such as JXMultiSplitPane and various third‑party split pane components that conform to the same API contract.
When setDividerSize is invoked, the split pane re‑validates and repaints itself immediately, updating the divider width