Creating the JTabbedPane

Lines 62–63 create a JTabbedPane to display the five containers in this program. The argument JTabbedPane.TOP sent to the constructor indicates that the tabs should appear at the top of the JTabbedPane. The argument JTabbedPane.SCROLL_TAB_LAYOUT specifies that the tabs should wrap to a new line if there are too many to fit on one line.

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.