diff --git a/.idea/misc.xml b/.idea/misc.xml index 0548357..57d62b3 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7834b9b..45136cb 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,6 @@ - - - - @@ -110,7 +108,7 @@ - + - - - @@ -170,7 +160,7 @@ - + 1562341097724 @@ -221,32 +211,11 @@ - - 1562347496252 - - - 1562347599281 - - - 1562347624079 - - - @@ -262,19 +231,19 @@ - + - + - + - + @@ -291,8 +260,7 @@ - - @@ -301,17 +269,10 @@ - - - - - - - - + - - + + @@ -322,26 +283,35 @@ - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + diff --git a/out/production/Alpha/Main.class b/out/production/Alpha/Main.class index edf0104..2f81af4 100644 Binary files a/out/production/Alpha/Main.class and b/out/production/Alpha/Main.class differ diff --git a/src/Main.java b/src/Main.java index 4abeb99..4b45221 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,5 +1,6 @@ import javax.swing.*; - +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class Main { //Variablen GUI @@ -8,7 +9,7 @@ public class Main { JMenu jm = null; JPanel contantPane = null; JLabel label = null; - + JMenuItem jmI = null; //Konstruktor Gui public Main(){ this.fr = new JFrame("Coutinius Integration"); @@ -18,19 +19,31 @@ public class Main { this.fr.setJMenuBar(jmb); this.jm = new JMenu("File"); this.jmb.add(jm); + this.jmI = new JMenuItem("Exit"); + this.jm.add(jmI); + this.jmI.addActionListener(new ActionListener1()); this.contantPane = new JPanel(); - fr.setContentPane(contantPane); - - contantPane.add(new JLabel("Beispiel JLabel")); - // Wir lassen unseren Frame anzeigen - contantPane.setVisible(true); - fr.setVisible(true); + this.fr.setContentPane(contantPane); + this.contantPane.add(new JLabel("Beispiel JLabel")); + this.contantPane.setVisible(true); + this.fr.setVisible(true); } public static void main(String[] args) { System.out.println("Hello World!"); Main mn = new Main(); + } +// Action Listener + private class ActionListener1 implements ActionListener{ + @Override + public void actionPerformed(ActionEvent e) { + + System.exit(0); + } + } + + }