Add an ArrayList of persons to the Person class.
[Persons_Comparator.git] / src / MainWindowsView.java
index 729a9ad20382654cc21213f283a6f455e7d9f0c8..dbe2eedaf9beaee2f2f75da5c24374cbfa21121e 100644 (file)
@@ -6,7 +6,7 @@ import java.util.ArrayList;
 
 public class MainWindowsView extends JFrame {
 
-    MainWindowsView(String title) {
+    MainWindowsView(String title, JPanel panel) {
         //Create and set up the window.
         setTitle(title);
         setSize(300, 300);
@@ -26,9 +26,6 @@ public class MainWindowsView extends JFrame {
         });
         fileMenu.add(exit);
 
-        //Main pane
-        JPanel panel = new PersonView();
-
         //Get all Swing/AWT primitive components in the views and add them to the panel.
         ArrayList<Component> components = new ArrayList<>();
         for (int i = 0; i < panel.getComponentCount(); i++) {