Split the person panel into two sub panels : one for the current person, one for...
[Persons_Comparator.git] / src / MainWindowsView.java
index 58a37fb435f4a011af37a213a5adcdab9f9004c1..0ff9bbbe242bbcaaf3c2027d0204a910f929e94f 100644 (file)
@@ -8,10 +8,11 @@ import java.util.ArrayList;
 
 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(400, 300);
+        setSize(view.getDimension());
         setLocationRelativeTo(null);
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
@@ -28,7 +29,11 @@ public class MainWindowsView extends JFrame {
             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);
     }
 
     /**
@@ -77,9 +82,10 @@ public class MainWindowsView extends JFrame {
      * 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