User Tools

Site Tools


generic_starter_code

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
generic_starter_code [2019/05/22 10:03] frchrisgeneric_starter_code [2019/05/22 10:06] (current) frchris
Line 1: Line 1:
 +This is a Graphics Application that quits on a close window, and a KeyListener to react to keys typed on the keyboard.
 +
 <code> <code>
 import java.awt.Color; import java.awt.Color;
Line 10: Line 12:
 public class MyGenericApplication extends JPanel implements KeyListener public class MyGenericApplication extends JPanel implements KeyListener
 { {
- public static int WIDTH=800; +    public static int WIDTH=800; 
- public static int HEIGHT=600;+    public static int HEIGHT=600;
     private Font titleFont, regularFont;     private Font titleFont, regularFont;
          
Line 52: Line 54:
  }  }
  
- // These 3 methods need to be declares to implement the KeyListener Interface+ // These 3 methods need to be declared to implement the KeyListener Interface
  @Override  @Override
  public void keyTyped(KeyEvent e) {}  public void keyTyped(KeyEvent e) {}
generic_starter_code.txt · Last modified: 2019/05/22 10:06 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki