X-Git-Url: https://git.piment-noir.org/?p=Persons_Comparator.git;a=blobdiff_plain;f=src%2FMainWindowsView.java;h=0b89d5d44868d5e267c28ae68919018251f3f0fe;hp=c3688ba206e60bf9f7ef80b3bf9a145d71e8893e;hb=3d9fdaf4ca1feb8d0e788f2f0c948d87439e2414;hpb=d119e60d58d8431de3ff29090d7048b0eb7d9f9e diff --git a/src/MainWindowsView.java b/src/MainWindowsView.java index c3688ba..0b89d5d 100644 --- a/src/MainWindowsView.java +++ b/src/MainWindowsView.java @@ -26,15 +26,10 @@ public class MainWindowsView extends JFrame { }); fileMenu.add(exit); - //Get all Swing/AWT primitive components in the views and add them to the main panel. + //Get all Swing/AWT JPanel in the views and add them to the main panel. ArrayList components = new ArrayList<>(); for (int i = 0; i < panel.getComponentCount(); i++) { - if ((panel.getComponent(i) instanceof Container)) { - Container subContainer = (Container) panel.getComponent(i); - for (int j = 0; j < subContainer.getComponentCount(); j++) { - components.add(subContainer.getComponent(j)); - } - } + components.add(panel.getComponent(i)); } for (Component component : components) { panel.add(component);