Put each view inside its own panel and add each panel to the main panel.
[Persons_Comparator.git] / src / EyeView.java
index f976a4e81187fea41e49e8ed4086e00bc9a01f0e..a80a31a768ed5d4f21abdfd690b1aa9939a28ebc 100644 (file)
@@ -1,6 +1,6 @@
 import javax.swing.*;
 
-public class EyeView extends JComponent {
+public class EyeView extends JPanel {
     private Eye eyeObj;
     private JLabel label;
     private JComboBox colorsList;
@@ -13,8 +13,7 @@ public class EyeView extends JComponent {
         this.label = new JLabel();
         this.label.setText("Eyes color");
         this.colorsList = new JComboBox<>(this.getEyeObj().getColorsList());
-        if (this.getEyeObj().getStrColor() != null)
-            this.colorsList.setSelectedItem(this.getEyeObj().getStrColor());
+        this.colorsList.setSelectedItem(this.getEyeObj().getStrColor());
         add(label);
         add(colorsList);
     }