import uwcse.graphics.*; /** * The "extends GWindowEventAdapter" means that an * InhertanceWindowListener object IS a GWindowEventAdapter * object as well. So, it can already receive all those * messages. We "override" here the ones for the keyboard, * to do what we want (just print). */ public class InheritanceWindowListener extends GWindowEventAdapter { public void keyPressed(GWindowEvent e) { System.out.println("keyPressed: " + e.toString() ); } public void keyReleased(GWindowEvent e) { System.out.println("keyReleased: " + e.toString() ); } }