June 2017
Beginner
1296 pages
69h 23m
English
1 // Fig. 22.17: BoxLayoutDemo.java
2 // Demonstrating BoxLayout.
3 import javax.swing.JFrame;
4
5 public class BoxLayoutDemo
6 {
7 public static void main(String[] args)
8 {
9 BoxLayoutFrame boxLayoutFrame = new BoxLayoutFrame();
10 boxLayoutFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
11 boxLayoutFrame.setSize(400, 220);
12 boxLayoutFrame.setVisible(true);
13 }
14 } // end class BoxLayoutDemo

Box ContainersLines 19–22 create Box containers. References horizontal1 and horizontal2 are initialized with static Box method createHorizontalBox, which returns a ...
Read now
Unlock full access