|
|
@ -33,7 +33,9 @@ import javax.swing.JPanel; |
|
|
|
import javax.swing.LayoutStyle.ComponentPlacement; |
|
|
|
import javax.swing.SwingConstants; |
|
|
|
|
|
|
|
public class SnakeGame { |
|
|
|
public class SnakeGame extends JFrame { |
|
|
|
|
|
|
|
private JPanel cP; |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
EventQueue.invokeLater(new Runnable() { |
|
|
@ -49,5 +51,14 @@ public class SnakeGame { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public SnakeGame() { |
|
|
|
setTitle("Snake"); |
|
|
|
setBounds(0, 0, 1200, 600); |
|
|
|
|
|
|
|
cP = new JPanel(); |
|
|
|
cP.setBorder(new EmptyBorder(5, 5, 5, 5)); |
|
|
|
setContentPane(cP); |
|
|
|
cP.setLayout(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|