6.6.1. Split Panes

A split pane splits a component into two parts, with an adjustable boundary in between. Figure 6.44 shows a frame with two split panes. The components in the outer split pane are arranged vertically, with a text area on the bottom and another split pane on the top. That split pane’s components are arranged horizontally, with a list on the left and a label containing an image on the right.

Image

Figure 6.44. A frame with two nested split panes

Construct a split pane by specifying the orientation—one of JSplitPane.HORIZONTAL_SPLIT or JSplitPane.VERTICAL_SPLIT, followed by the two components. For example,

JSplitPane innerPane = new ...

Get Core Java® Volume II—Advanced Features, Ninth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.