final JFrame frame = new JFrame("Form Example");
final JButton addButton = new JButton("Add");
final JButton deleteButton = new JButton("Delete");
final JButton modifyButton = new JButton("Modify");
final JButton closeButton = new JButton("Close");
final Box topbox = Box.createHorizontalBox();
final Box bottomBox = Box.createHorizontalBox();
final DefaultTableModel model = new DefaultTableModel();
model.addColumn("\u25A1");
model.addColumn("名称");
model.addColumn("类名称");
model.setRowCount(5);
final JTable classTable = new JTable(model);
topbox.add(Box.createHorizontalStrut(5));
topbox.add(addButton);
topbox.add(Box.createHorizontalStrut(5));
topbox.add(deleteButton);
topbox.add(Box.createHorizontalStrut(5));
topbox.add(modifyButton);
topbox.add(Box.createHorizontalGlue());
topbox.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
bottomBox.add(Box.createHorizontalGlue());
bottomBox.add(closeButton);
bottomBox.add(Box.createHorizontalStrut(5));
bottomBox.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
frame.add(topbox, BorderLayout.PAGE_START);
frame.add(new JScrollPane(classTable));
frame.add(bottomBox, BorderLayout.PAGE_END);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);