RelativePosition justBelow = new RelativePosition(Edge.TOP, 0, Direction.BELOW, Edge.BOTTOM);
RelativePosition justAbove = new RelativePosition(Edge.BOTTOM, 0, Direction.ABOVE, Edge.TOP);
RelativePosition eightBelow = new RelativePosition(Edge.TOP, 8, Direction.BELOW, Edge.BOTTOM);
RelativePosition eightRightOf = new RelativePosition(Edge.LEFT, 8, Direction.RIGHT, Edge.RIGHT);
RelativeConstraints toolbarConstraints = new RelativeConstraints();
toolbarConstraints
.addBindings(
new Binding(Edge.HORIZONTAL_CENTER, 0, Direction.LEFT, Edge.HORIZONTAL_CENTER, frame),
topEdge);
frame.add(toolbar, toolbarConstraints);
RelativeConstraints folderViewConstraints = new RelativeConstraints();
folderViewConstraints.addBindings(leftEdge, new Binding(justBelow, toolbar), new Binding(justAbove, statusBar));
frame.add(folderView, folderViewConstraints);
RelativeConstraints mailListConstraints = new RelativeConstraints();
mailListConstraints.addBindings(new Binding(justBelow, toolbar), new Binding(eightRightOf, folderView), rightEdge);
frame.add(mailList, mailListConstraints);
RelativeConstraints mailAreaConstraints = new RelativeConstraints();
mailAreaConstraints.addBindings(new Binding(eightBelow, mailList), new Binding(eightRightOf, folderView),
new Binding(justAbove, statusBar), rightEdge);
frame.add(mailArea, mailAreaConstraints);
RelativeConstraints statusBarConstraints = new RelativeConstraints();
statusBarConstraints.addBindings(bottomEdge, leftEdge, new Binding(Edge.RIGHT, 20, Direction.LEFT, Edge.RIGHT,
frame));
frame.add(statusBar, statusBarConstraints);
frame.setSize(800, 400);
frame.setVisible(true);