-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui.java
More file actions
26 lines (26 loc) · 722 Bytes
/
gui.java
File metadata and controls
26 lines (26 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import javax.swing.JFrame;
import java.awt.event.*;
public class gui
{
private static guipanel gp;
public static void main(String[]args)
{
JFrame frame = new JFrame("Conway's Game of Life");
frame.setSize(860,550);
frame.setLocation(100, 50);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
gp = new guipanel();
frame.setContentPane(gp);
frame.addKeyListener(new keylisten());
frame.setVisible(true);
}
public static class keylisten implements KeyListener
{
public void keyTyped(KeyEvent e) {}
public void keyPressed(KeyEvent e) {}
public void keyReleased(KeyEvent e)
{
gp.processkeys(e.getKeyChar());
}
}
}