Put each view inside its own panel and add each panel to the main panel.
[Persons_Comparator.git] / src / EyeView.java
CommitLineData
089fcbfc
JB
1import javax.swing.*;
2
d119e60d 3public class EyeView extends JPanel {
6977e614 4 private Eye eyeObj;
883508ca 5 private JLabel label;
d75d0a00 6 private JComboBox colorsList;
6977e614 7
b974e749
JB
8 /**
9 * @param eyeObj
10 */
11 EyeView(Eye eyeObj) {
12 setEyeObj(eyeObj);
883508ca
JB
13 this.label = new JLabel();
14 this.label.setText("Eyes color");
d75d0a00 15 this.colorsList = new JComboBox<>(this.getEyeObj().getColorsList());
d119e60d 16 this.colorsList.setSelectedItem(this.getEyeObj().getStrColor());
883508ca
JB
17 add(label);
18 add(colorsList);
089fcbfc
JB
19 }
20
ac6c3ea2 21 /**
ac6c3ea2
JB
22 * @return
23 */
6977e614
JB
24 public Eye getEyeObj() {
25 return eyeObj;
26 }
27
ac6c3ea2 28 /**
ac6c3ea2
JB
29 * @param eyeObj
30 */
6977e614
JB
31 public void setEyeObj(Eye eyeObj) {
32 this.eyeObj = eyeObj;
33 }
34}