Properly add all view JComponents to the JPanel in the main JFrame.
[Persons_Comparator.git] / src / FirstnameView.java
1 import javax.swing.*;
2
3 public class FirstnameView extends JComponent {
4 private Firstname firstnameObj;
5 private JTextField textField;
6 private JLabel label;
7
8 FirstnameView(int length) {
9 this.label = new JLabel();
10 this.label.setText("Firstname");
11 this.textField = new JTextField(length);
12 add(label);
13 add(textField);
14 }
15
16 public Firstname getFirstnameObj() {
17 return firstnameObj;
18 }
19
20 public void setFirstnameObj(Firstname firstnameObj) {
21 this.firstnameObj = firstnameObj;
22 }
23 }