-public class EyeView {
+import javax.swing.*;
+
+public class EyeView extends JComponent {
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());
+ if (this.getEyeObj().getStrColor() != null)
+ this.colorsList.setSelectedItem(this.getEyeObj().getStrColor());
+ add(label);
+ add(colorsList);
}
/**
- *
* @return
*/
public Eye getEyeObj() {
}
/**
- *
* @param eyeObj
*/
public void setEyeObj(Eye eyeObj) {