A lib directory to the project with gson library.
[Persons_Comparator.git] / src / EyeView.java
1 import javax.swing.*;
2
3 public class EyeView extends JComponent {
4 private Eye eyeObj;
5 private JLabel label;
6 private JList colorsList;
7
8 EyeView() {
9 setEyeObj(new Eye());
10 this.label = new JLabel();
11 this.label.setText("Eyes color");
12 this.colorsList = new JList(getEyeObj().getColorsList());
13 this.colorsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
14 this.colorsList.setLayoutOrientation(JList.VERTICAL);
15 add(label);
16 add(colorsList);
17 }
18
19 /**
20 * @param eyeObj
21 */
22 EyeView(Eye eyeObj) {
23 setEyeObj(eyeObj);
24 }
25
26 /**
27 * @return
28 */
29 public Eye getEyeObj() {
30 return eyeObj;
31 }
32
33 /**
34 * @param eyeObj
35 */
36 public void setEyeObj(Eye eyeObj) {
37 this.eyeObj = eyeObj;
38 }
39 }