Initial commit
This commit is contained in:
commit
4f4397b3e1
48 changed files with 2002 additions and 0 deletions
14
interface-segregation-gui/interface-segregation-gui.iml
Normal file
14
interface-segregation-gui/interface-segregation-gui.iml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="SonarLintModuleSettings">
|
||||
<option name="uniqueId" value="557e9ff7-d218-490c-86e2-6f46ea015e76" />
|
||||
</component>
|
||||
</module>
|
||||
44
interface-segregation-gui/src/de/limago/Fenster.java
Normal file
44
interface-segregation-gui/src/de/limago/Fenster.java
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
package de.limago;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
|
||||
public class Fenster extends Frame {
|
||||
|
||||
|
||||
public Fenster() {
|
||||
|
||||
setSize(300, 300);
|
||||
Button button = new Button("Drück mich");
|
||||
button.addActionListener(e->ausgabe());
|
||||
add(button);
|
||||
addWindowListener(new MyWindowListener());
|
||||
}
|
||||
|
||||
private void ausgabe() {
|
||||
System.out.println("Button wurde gedrueckt");
|
||||
}
|
||||
|
||||
private void beenden() {
|
||||
dispose();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
new Fenster().setVisible(true);
|
||||
}
|
||||
|
||||
/*private class ButtonListener implements ActionListener {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ausgabe();
|
||||
}
|
||||
}*/
|
||||
|
||||
private class MyWindowListener extends WindowAdapter {
|
||||
@Override
|
||||
public void windowClosing(final WindowEvent e) {
|
||||
beenden();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue