Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
-public class EyeView extends JComponent {
+public class EyeView extends JPanel {
private Eye eyeObj;
private JLabel label;
private JComboBox colorsList;
private Eye eyeObj;
private JLabel label;
private JComboBox colorsList;
this.label = new JLabel();
this.label.setText("Eyes color");
this.colorsList = new JComboBox<>(this.getEyeObj().getColorsList());
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());
+ this.colorsList.setSelectedItem(this.getEyeObj().getStrColor());
add(label);
add(colorsList);
}
add(label);
add(colorsList);
}
-public class FirstnameView extends JComponent {
+public class FirstnameView extends JPanel {
private Firstname firstnameObj;
private JTextField textField;
private JLabel label;
private Firstname firstnameObj;
private JTextField textField;
private JLabel label;
Person person4 = new Person("Sophia", "Brasil", 155, 57, "blue");
personArrayList.add(person4);
Person person4 = new Person("Sophia", "Brasil", 155, 57, "blue");
personArrayList.add(person4);
- Person emptyPerson = new Person();
+ //Person emptyPerson = new Person();
+ Person emptyPerson = person2;
emptyPerson.setPersonArrayList(personArrayList);
PersonView emptyPersonView = new PersonView(emptyPerson);
emptyPerson.setPersonArrayList(personArrayList);
PersonView emptyPersonView = new PersonView(emptyPerson);
- //Get all Swing/AWT primitive components in the views and add them to the panel.
+ //Get all Swing/AWT primitive components in the views and add them to the main panel.
ArrayList<Component> components = new ArrayList<>();
for (int i = 0; i < panel.getComponentCount(); i++) {
if ((panel.getComponent(i) instanceof Container)) {
ArrayList<Component> components = new ArrayList<>();
for (int i = 0; i < panel.getComponentCount(); i++) {
if ((panel.getComponent(i) instanceof Container)) {
-public class OriginView extends JComponent {
+public class OriginView extends JPanel {
private Origin originObj;
private JLabel label;
private Origin originObj;
private JLabel label;
-public class SizeView extends JComponent {
+public class SizeView extends JPanel {
private Size sizeObj;
private JLabel label;
private Size sizeObj;
private JLabel label;
-public class WeightView extends JComponent {
+public class WeightView extends JPanel {
private Weight weightObj;
private JLabel label;
private Weight weightObj;
private JLabel label;