Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ProjectBackup/Java/SnakeGame/src/gui/GUI.java
2022-09-04 12:45:01 +02:00

35 lines
728 B
Java

package gui;
import actions.KeyHandler;
import javax.swing.*;
public class GUI {
JFrame jf;
Draw d;
public static int with = 800;
public static int height = 600;
public static int xOff = 170;
public static int yOff = 20;
public void create() {
jf = new JFrame("Snake");
jf.setSize(with, height);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jf.setLocationRelativeTo(null);
jf.setLayout(null);
jf.setResizable(false);
jf.addKeyListener(new KeyHandler());
d = new Draw();
d.setBounds(0, 0, with, height);
d.setVisible(true);
jf.add(d);
jf.requestFocus();
jf.setVisible(true);
}
}