SimpleGUICloser

App Image

Bugview 
   April 2nd, 2008
907 views / 674 downloads
Admin Administrator: Bug Labs teamjconnolly

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:


  1. Constructs and shows a frame at half the screen resolution height and width.

  2. Constructs a simple static label

  3. 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

  4. 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:


  1. Use anonymous inner classing for speedy coding and convenient handling of events (MouseEvent, MouseAdapter).

  2. 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


Download


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

other