repositories
/
Persons_Comparator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Put each view inside its own panel and add each panel to the main panel.
[Persons_Comparator.git]
/
src
/
FirstnameView.java
diff --git
a/src/FirstnameView.java
b/src/FirstnameView.java
index e9c387baa50ec142367facc28972e5c83820ba5c..b7b85680290a51ca5c6c28e21bf1c92db3cdd3fe 100644
(file)
--- a/
src/FirstnameView.java
+++ b/
src/FirstnameView.java
@@
-1,14
+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);
+ this.textField.setText(firstnameObj.getFirstname());
add(label);
add(textField);
}
add(label);
add(textField);
}