June 2017
Beginner
1296 pages
69h 23m
English
... main(String[] args) 8 {
9 TextAreaFrame textAreaFrame = new TextAreaFrame();
10 textAreaFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
11 textAreaFrame.setSize(425, 200);
12 textAreaFrame.setVisible(true);
13 }
14 }

In the constructor (lines 18–48), line 21 creates a Box container (package javax.swing) to organize the GUI components. Box is a subclass of Container that uses a BoxLayout layout manager (discussed in detail in Section 35.9) to arrange the GUI components either horizontally or vertically. Box’s static method createHorizontalBox creates a Box that arranges components from left to right in the order that ...
Read now
Unlock full access