generic_starter_code
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
generic_starter_code [2019/05/22 10:03] – frchris | generic_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. | ||
+ | |||
< | < | ||
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 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 | + | // These 3 methods need to be declared |
@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