Add an ArrayList of persons to the Person class.
[Persons_Comparator.git] / src / EyeView.java
CommitLineData
089fcbfc
JB
1import javax.swing.*;
2
3public class EyeView extends JComponent {
6977e614 4 private Eye eyeObj;
883508ca
JB
5 private JLabel label;
6 private JList 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");
15 this.colorsList = new JList(getEyeObj().getColorsList());
16 this.colorsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
f1e9d6d2 17 this.colorsList.setLayoutOrientation(JList.VERTICAL);
883508ca
JB
18 add(label);
19 add(colorsList);
089fcbfc
JB
20 }
21
ac6c3ea2 22 /**
ac6c3ea2
JB
23 * @return
24 */
6977e614
JB
25 public Eye getEyeObj() {
26 return eyeObj;
27 }
28
ac6c3ea2 29 /**
ac6c3ea2
JB
30 * @param eyeObj
31 */
6977e614
JB
32 public void setEyeObj(Eye eyeObj) {
33 this.eyeObj = eyeObj;
34 }
35}