From cb1aa38288001b33652db7ac8329ae6ece8c493a Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 25 Jan 2023 10:34:38 +0100 Subject: [PATCH] [SnakeGame Class]: added Content Pane --- .../JavaGamelauncher/SnakeGame.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java index 08cffc0..b041d58 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/SnakeGame.java +++ b/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.SwingConstants; -public class SnakeGame { +public class SnakeGame extends JFrame { + + private JPanel cP; public static void main(String[] args) { 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); + } }