Properly add all view JComponents to the JPanel in the main JFrame.
[Persons_Comparator.git] / src / FirstnameView.java
CommitLineData
089fcbfc
JB
1import javax.swing.*;
2
3public class FirstnameView extends JComponent {
6977e614 4 private Firstname firstnameObj;
089fcbfc
JB
5 private JTextField textField;
6 private JLabel label;
6977e614 7
089fcbfc
JB
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);
6977e614
JB
14 }
15
16 public Firstname getFirstnameObj() {
17 return firstnameObj;
18 }
19
20 public void setFirstnameObj(Firstname firstnameObj) {
21 this.firstnameObj = firstnameObj;
22 }
23}