X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FOriginView.java;h=a5df1ad987e4e353ad939763d51856f2c1f0bfc0;hb=1a2ddb852431259fab5dc522d8caf5b74bb3acd8;hp=695a90cc53b7e41e9d53c50d4c770a91c36fb62d;hpb=b974e749af3a4b2df3737b2d361233c704dcc4d8;p=Persons_Comparator.git diff --git a/src/OriginView.java b/src/OriginView.java index 695a90c..a5df1ad 100644 --- a/src/OriginView.java +++ b/src/OriginView.java @@ -1,14 +1,23 @@ import javax.swing.*; -public class OriginView extends JComponent { +public class OriginView extends JPanel { private Origin originObj; private JLabel label; + private JComboBox comboBox; + //FIXME: this label should be refreshed on country selection. + private JLabel continentLabel; OriginView(Origin originObj) { setOriginObj(originObj); this.label = new JLabel(); this.label.setText("Origin"); + this.comboBox = new JComboBox<>(this.getOriginObj().getCountriesArray()); + this.comboBox.setSelectedItem(this.getOriginObj().getCountry()); + this.continentLabel = new JLabel(); + this.continentLabel.setText("(" + this.getOriginObj().getContinent() + ")"); add(label); + add(comboBox); + add(continentLabel); } public Origin getOriginObj() {