wholePanel.add(buttonPanel, BorderLayout.SOUTH);
contentPane.add(wholePanel, BorderLayout.CENTER);
contentPane.add(subPanel, BorderLayout.SOUTH);
w.pack();
w.setResizable(true);
w.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
w.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {