private Box createMainBox() {
Box box = Box.createHorizontalBox();
// box.setBorder(BorderFactory.createLineBorder(Color.BLUE));
box.add(createLeftBox());
box.add(createRightBox());
return box;
}
private Box createLeftBox() {
Box box = Box.createVerticalBox();
// box.setBorder(BorderFactory.createLineBorder(Color.GREEN));
box.add(new JButton("Button One"));
box.add(Box.createVerticalStrut(12));
box.add(new JButton("Button Two"));
box.add(Box.createVerticalGlue());
return box;
}
private Box createRightBox() {
Box box = Box.createVerticalBox();
// box.setBorder(BorderFactory.createLineBorder(Color.RED));
box.add(Box.createVerticalGlue());
box.add(new JButton("Button Three"));
box.add(new JButton("Button Four"));
box.add(new JButton("Button Five"));
return box;
}
|