Add listener to specific events like country selection.
[Persons_Comparator.git] / src / PersonView.java
index 675f37f3ab7f72b17dabbaec15feee6a5f17a1bc..e703ef3c60b75d5020b87a0dc056ed9e32e0f400 100644 (file)
@@ -1,7 +1,9 @@
 import javax.swing.*;
 import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 
-public class PersonView extends JPanel {
+public class PersonView extends JPanel implements ActionListener {
     private int width = 400;
     private int height = 600;
     private Person personObj;
@@ -23,6 +25,7 @@ public class PersonView extends JPanel {
         setWeightView(new WeightView(this.personObj.getWeight()));
         setEyeView(new EyeView(this.personObj.getEye()));
 
+        this.compareButton.addActionListener(this);
         JLabel personLabel = new JLabel("Closest person found");
         personPanel.add(personLabel);
         setPreferredSize(new Dimension(this.width, this.height));
@@ -113,4 +116,9 @@ public class PersonView extends JPanel {
     public EyeView getEyeView() {
         return eyeView;
     }
+
+    @Override
+    public void actionPerformed(ActionEvent actionEvent) {
+
+    }
 }