repositories
/
Persons_Comparator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Start the implementation of inputs gathering and the comparator code (still buggy...
[Persons_Comparator.git]
/
src
/
FirstnameView.java
diff --git
a/src/FirstnameView.java
b/src/FirstnameView.java
index 3ff29770357320cdeaff4b132cbc0208c6878874..cd253e502651f9b11035ba65ab7ed0b21eb83bdd 100644
(file)
--- a/
src/FirstnameView.java
+++ b/
src/FirstnameView.java
@@
-1,17
+1,16
@@
import javax.swing.*;
import javax.swing.*;
-public class FirstnameView extends J
Component
{
+public class FirstnameView extends J
Panel
{
private Firstname firstnameObj;
private JTextField textField;
private JLabel label;
private Firstname firstnameObj;
private JTextField textField;
private JLabel label;
- FirstnameView(int length) {
+ FirstnameView(int length, Firstname firstnameObj) {
+ setFirstnameObj(firstnameObj);
this.label = new JLabel();
this.label.setText("Firstname");
this.textField = new JTextField(length);
this.label = new JLabel();
this.label.setText("Firstname");
this.textField = new JTextField(length);
- if (firstnameObj != null) {
- this.textField.setText(this.firstnameObj.getFirstname());
- }
+ this.textField.setText(this.getFirstnameObj().getFirstname());
add(label);
add(textField);
}
add(label);
add(textField);
}
@@
-23,4
+22,8
@@
public class FirstnameView extends JComponent {
public void setFirstnameObj(Firstname firstnameObj) {
this.firstnameObj = firstnameObj;
}
public void setFirstnameObj(Firstname firstnameObj) {
this.firstnameObj = firstnameObj;
}
+
+ public JTextField getTextField() {
+ return textField;
+ }
}
}