X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FFirstnameView.java;h=8634dc71ac715b2b868398aae1331d2ccf1d48e2;hb=b974e749af3a4b2df3737b2d361233c704dcc4d8;hp=18323cfe474ec86392cf064e85bd1fc965d447fc;hpb=6977e6142a133673703769e092e6283dda73cf4f;p=Persons_Comparator.git diff --git a/src/FirstnameView.java b/src/FirstnameView.java index 18323cf..8634dc7 100644 --- a/src/FirstnameView.java +++ b/src/FirstnameView.java @@ -1,8 +1,18 @@ -public class FirstnameView { +import javax.swing.*; + +public class FirstnameView extends JComponent { private Firstname firstnameObj; + private JTextField textField; + private JLabel label; - FirstnameView(Firstname firstnameObj) { + FirstnameView(int length, Firstname firstnameObj) { setFirstnameObj(firstnameObj); + this.label = new JLabel(); + this.label.setText("Firstname"); + this.textField = new JTextField(length); + this.textField.setText(firstnameObj.getFirstname()); + add(label); + add(textField); } public Firstname getFirstnameObj() {