Skip to content

Commit

Permalink
java-practice-window-close
Browse files Browse the repository at this point in the history
  • Loading branch information
rajjitlai committed Nov 22, 2024
1 parent abbdf81 commit 1a75976
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Binary file added Java/practice/WindowExample.class
Binary file not shown.
38 changes: 38 additions & 0 deletions Java/practice/WindowExample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import java.awt.*;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

public class WindowExample extends Frame implements WindowListener {
WindowExample() {
addWindowListener(this);
setSize(400, 400);
setLayout(null);
setVisible(true);
}

public static void main(String[] args) {
new WindowExample();
}

public void windowActivated(WindowEvent e) {
}

public void windowClosed(WindowEvent e) {
}

public void windowClosing(WindowEvent e) {
dispose();
}

public void windowDeactivated(WindowEvent e) {
}

public void windowDeiconified(WindowEvent e) {
}

public void windowIconified(WindowEvent e) {
}

public void windowOpened(WindowEvent arg0) {
}
}

0 comments on commit 1a75976

Please sign in to comment.