Put each view inside its own panel and add each panel to the main panel.
[Persons_Comparator.git] / src / EyeView.java
index 38664936de7d52df01382c8e7fab7ff980a3a969..a80a31a768ed5d4f21abdfd690b1aa9939a28ebc 100644 (file)
@@ -1,16 +1,24 @@
-public class EyeView {
+import javax.swing.*;
+
+public class EyeView extends JPanel {
     private Eye eyeObj;
+    private JLabel label;
+    private JComboBox colorsList;
 
     /**
-     *
      * @param eyeObj
      */
     EyeView(Eye eyeObj) {
         setEyeObj(eyeObj);
+        this.label = new JLabel();
+        this.label.setText("Eyes color");
+        this.colorsList = new JComboBox<>(this.getEyeObj().getColorsList());
+        this.colorsList.setSelectedItem(this.getEyeObj().getStrColor());
+        add(label);
+        add(colorsList);
     }
 
     /**
-     *
      * @return
      */
     public Eye getEyeObj() {
@@ -18,7 +26,6 @@ public class EyeView {
     }
 
     /**
-     *
      * @param eyeObj
      */
     public void setEyeObj(Eye eyeObj) {