public class MainWindowsView extends JFrame {
- MainWindowsView(String title, JPanel panel) {
+ MainWindowsView(String title, PersonView view) {
+ Container panel = getContentPane();
//Create and set up the window.
setTitle(title);
- setSize(300, 300);
+ setSize(view.getDimension());
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
panel.add(component);
}
- setContentPane(panel);
+ panel.add(view.getNorthPanel(), BorderLayout.NORTH);
+ panel.add(view.getSouthPanel(), BorderLayout.SOUTH);
+ panel.add(view.getEastPanel(), BorderLayout.EAST);
+ panel.add(view.getWestPanel(), BorderLayout.WEST);
+ panel.add(view.getPersonPanel(), BorderLayout.CENTER);
}
/**
* event-dispatching thread.
*/
public void showGUI() {
-
+ System.out.println("Created GUI on EDT? " +
+ SwingUtilities.isEventDispatchThread());
//Display the window.
- //this.pack();
+ this.pack();
this.setVisible(true);
}
}
\ No newline at end of file