From aacd3b55a4eb41932c26eb16325db5e04b050fe7 Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 25 Jan 2023 10:51:55 +0100 Subject: [PATCH] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20der=20?= =?UTF-8?q?Panel=201&2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGame.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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 b041d58..879407b 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 @@ -36,6 +36,12 @@ import javax.swing.SwingConstants; public class SnakeGame extends JFrame { private JPanel cP; + public JPanel panel1; + public JPanel panel2; + + public int breite = 1200; + public int hoehe = 600; + public String titel = "Snake"; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { @@ -59,6 +65,20 @@ public class SnakeGame extends JFrame { cP.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(cP); cP.setLayout(null); + + panel1 = new JPanel(); + panel1.setBounds(300, 0, 100, 100); + panel1.setVisible(true); + panel1.setBackground(Color.BLACK); + + cP.add(panel1); + + panel2 = new JPanel(); + panel2.setBounds(400, 0, 100, 100); + panel2.setVisible(true); + panel2.setBackground(Color.BLACK); + + cP.add(panel2); } }