import javax.swing.*;
-public class EyeView extends JComponent {
+public class EyeView extends JPanel {
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());
- if (this.getEyeObj().getStrColor() != null)
- this.colorsList.setSelectedItem(this.getEyeObj().getStrColor());
+ this.colorsList.setSelectedItem(this.getEyeObj().getStrColor());
add(label);
add(colorsList);
}
import javax.swing.*;
-public class FirstnameView extends JComponent {
+public class FirstnameView extends JPanel {
private Firstname firstnameObj;
private JTextField textField;
private JLabel label;
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);
});
fileMenu.add(exit);
- //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)) {
import javax.swing.*;
-public class OriginView extends JComponent {
+public class OriginView extends JPanel {
private Origin originObj;
private JLabel label;
import javax.swing.*;
-public class SizeView extends JComponent {
+public class SizeView extends JPanel {
private Size sizeObj;
private JLabel label;
import javax.swing.*;
-public class WeightView extends JComponent {
+public class WeightView extends JPanel {
private Weight weightObj;
private JLabel label;