Properly add all view JComponents to the JPanel in the main JFrame.
[Persons_Comparator.git] / src / FirstnameView.java
index 18323cfe474ec86392cf064e85bd1fc965d447fc..e9c387baa50ec142367facc28972e5c83820ba5c 100644 (file)
@@ -1,8 +1,16 @@
-public class FirstnameView {
+import javax.swing.*;
+
+public class FirstnameView extends JComponent {
     private Firstname firstnameObj;
+    private JTextField textField;
+    private JLabel label;
 
-    FirstnameView(Firstname firstnameObj) {
-        setFirstnameObj(firstnameObj);
+    FirstnameView(int length) {
+        this.label = new JLabel();
+        this.label.setText("Firstname");
+        this.textField = new JTextField(length);
+        add(label);
+        add(textField);
     }
 
     public Firstname getFirstnameObj() {