Start the implementation of inputs gathering and the comparator code (still buggy...
[Persons_Comparator.git] / src / FirstnameView.java
index 18323cfe474ec86392cf064e85bd1fc965d447fc..cd253e502651f9b11035ba65ab7ed0b21eb83bdd 100644 (file)
@@ -1,8 +1,18 @@
-public class FirstnameView {
+import javax.swing.*;
+
+public class FirstnameView extends JPanel {
     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(this.getFirstnameObj().getFirstname());
+        add(label);
+        add(textField);
     }
 
     public Firstname getFirstnameObj() {
@@ -12,4 +22,8 @@ public class FirstnameView {
     public void setFirstnameObj(Firstname firstnameObj) {
         this.firstnameObj = firstnameObj;
     }
+
+    public JTextField getTextField() {
+        return textField;
+    }
 }