Commit | Line | Data |
---|---|---|
b974e749 JB |
1 | import java.util.ArrayList; |
2 | ||
35d7ecda JB |
3 | public class Main { |
4 | ||
5 | public static void main(String[] args) { | |
6 | //Schedule a job for the event-dispatching thread: | |
7 | //creating and showing this application's GUI. | |
60971873 JB |
8 | String programName = "Person Comparator"; |
9 | ||
b974e749 | 10 | ArrayList<Person> personArrayList = new ArrayList<>(); |
1a2ddb85 | 11 | Person person1 = new Person("Alan", "United States of America", 180, 95, "black"); |
b974e749 JB |
12 | personArrayList.add(person1); |
13 | Person person2 = new Person("Brice", "France", 190, 82, "brown"); | |
14 | personArrayList.add(person2); | |
15 | Person person3 = new Person("Alexandre", "France", 175, 73, "green"); | |
16 | personArrayList.add(person3); | |
17 | Person person4 = new Person("Sophia", "Brasil", 155, 57, "blue"); | |
18 | personArrayList.add(person4); | |
f1e9d6d2 | 19 | |
3d9fdaf4 | 20 | Person emptyPerson = new Person(); |
b974e749 JB |
21 | emptyPerson.setPersonArrayList(personArrayList); |
22 | PersonView emptyPersonView = new PersonView(emptyPerson); | |
35d7ecda JB |
23 | |
24 | javax.swing.SwingUtilities.invokeLater(new Runnable() { | |
25 | public void run() { | |
b974e749 JB |
26 | MainWindowsView mainWindows = new MainWindowsView(programName, emptyPersonView); |
27 | mainWindows.showGUI(); | |
35d7ecda JB |
28 | } |
29 | }); | |
30 | } | |
31 | } |