Browse Source

[SnakeGame Class]: added Content Pane

remotes/origin/SnakeGame
fdai7551 2 years ago
parent
commit
cb1aa38288
  1. 15
      JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java

15
JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java

@ -33,7 +33,9 @@ import javax.swing.JPanel;
import javax.swing.LayoutStyle.ComponentPlacement; import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
public class SnakeGame {
public class SnakeGame extends JFrame {
private JPanel cP;
public static void main(String[] args) { public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() { EventQueue.invokeLater(new Runnable() {
@ -48,6 +50,15 @@ 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);
}
} }
Loading…
Cancel
Save