![]() |
April 2nd, 2008 907 views / 674 downloads Category: Tutorials Maturity: Stable Tags: AnonymousInnerClasses WindowAdapter WindowEvents AWT Example MouseAdapter MouseEvent WindowEvent Download Latest Version |
Simple application (a la SimpleGUI from kschultz) demonstrating how to close a Frame by overriding the relevant methods in java.awt.event.WindowAdapter
What it does:
- Constructs and shows a frame at half the screen resolution height and width.
- Constructs a simple static label
- Constructs a canvas, which responds to MouseEvents by changing the background color (white for out, green for in) and prints to console information regarding the MouseEvent
- Registers an anonymous inner WindowAdapter to listen to the Frame for window events, disposing of the Frame (and printing to console) when the frame has been closed.
What it shows:
- Use anonymous inner classing for speedy coding and convenient handling of events (MouseEvent, MouseAdapter).
- Use of anonymous inner WindowAdapter (abstract class) to handle WindowEvents
For more information about AWT, WindowEvents, WindowAdapter, etc, please see here for brief overview:
http://www.exampledepot.com/egs/java.awt/pkg.html
For more information about use of Anonymous Inner Classing, see a short lecture at Stanford:
Please feel free to email me at jconnolly [at] buglabs.net for information. Or check out BUGLabs on IRC:
irc://irc.freenode.net/buglabs
| Version | Date | Uploaded by | Notes | |
|---|---|---|---|---|
| Version 4 | September 10th, 2008 | jconnolly | (more) (collapse) | download |
| Version 3 | September 10th, 2008 | jconnolly | (more) (collapse) | download |
| Version 2 | September 10th, 2008 | jconnolly | (more) (collapse) | download |
| Version 1 | April 2nd, 2008 | jconnolly | (more) (collapse) | download |


