pinnwand

bpaste has migrated platforms. We now support self removal of pastes and will automatically import pastes from our old software for the following 2 months (that is, until the end of november 2014).

If you have any pastes you'd like to preserve please visit their URLs and they will be automatically imported with no expiry.

This paste never expires. Pasted by import. View raw.

 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package game;

import java.awt.Dimension;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class Game extends JPanel {

    private static Dimension screendim = new Dimension(500, 500);

    public Game(int speed1, int speed2) {
	initPanel();
    }

    private void initPanel() {
	setLocation(0, 0);
	setSize(screendim);
	setFocusable(true);
	addKeyListener(new KeyListener() {

	    @Override
	    public void keyPressed(KeyEvent arg0) {
		System.out.println("worked");
	    }

	    @Override
	    public void keyReleased(KeyEvent e) {
	    }

	    @Override
	    public void keyTyped(KeyEvent e) {
	    }

	    
	});
	setFocusable(true);
	requestFocus();
	setDoubleBuffered(true);
    }


}