X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FFirstnameView.java;h=cd253e502651f9b11035ba65ab7ed0b21eb83bdd;hb=9b3bfcdd95253a04ed12a676ee29a9d777c1e496;hp=8634dc71ac715b2b868398aae1331d2ccf1d48e2;hpb=b974e749af3a4b2df3737b2d361233c704dcc4d8;p=Persons_Comparator.git diff --git a/src/FirstnameView.java b/src/FirstnameView.java index 8634dc7..cd253e5 100644 --- a/src/FirstnameView.java +++ b/src/FirstnameView.java @@ -1,6 +1,6 @@ import javax.swing.*; -public class FirstnameView extends JComponent { +public class FirstnameView extends JPanel { private Firstname firstnameObj; private JTextField textField; private JLabel label; @@ -10,7 +10,7 @@ public class FirstnameView extends JComponent { this.label = new JLabel(); this.label.setText("Firstname"); this.textField = new JTextField(length); - this.textField.setText(firstnameObj.getFirstname()); + this.textField.setText(this.getFirstnameObj().getFirstname()); add(label); add(textField); } @@ -22,4 +22,8 @@ public class FirstnameView extends JComponent { public void setFirstnameObj(Firstname firstnameObj) { this.firstnameObj = firstnameObj; } + + public JTextField getTextField() { + return textField; + } }