From a0d0b1db3e7594c18272690fd3ee39dd73eb3cba Mon Sep 17 00:00:00 2001 From: fdai7551 Date: Wed, 1 Feb 2023 10:19:49 +0100 Subject: [PATCH] =?UTF-8?q?[SnakeGame=20Class]:=20hinzuf=C3=BCgen=20des=20?= =?UTF-8?q?Panels=208?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/SnakeGame.java | 43 +++++++------------ 1 file changed, 16 insertions(+), 27 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 4ba3f0e..a3054ed 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 @@ -1,37 +1,18 @@ package de.hs_fulda.gruppenprojekt.JavaGamelauncher; -import java.awt.AWTException; -import java.awt.BorderLayout; -import java.awt.CardLayout; +import java.io.*; import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.EventQueue; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.image.BufferedImage; -import java.awt.Image; -import java.awt.Taskbar; -import java.awt.Toolkit; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; +import java.io.BufferedReader; import java.io.IOException; -import java.lang.System.Logger.Level; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.logging.Logger; -import javax.imageio.ImageIO; -import javax.swing.border.EmptyBorder; -import javax.swing.GroupLayout.Alignment; -import javax.swing.GroupLayout; -import javax.swing.ImageIcon; -import javax.swing.JButton; +import java.io.InputStreamReader; +import java.io.Reader; + import javax.swing.JFrame; -import javax.swing.JLabel; import javax.swing.JPanel; -import javax.swing.LayoutStyle.ComponentPlacement; -import javax.swing.SwingConstants; +import javax.swing.border.EmptyBorder; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; public class SnakeGame extends JFrame { @@ -43,6 +24,7 @@ public class SnakeGame extends JFrame { public JPanel panel5; public JPanel panel6; public JPanel panel7; + public JPanel panel8; public int breite = 1200; public int hoehe = 600; @@ -121,6 +103,13 @@ public class SnakeGame extends JFrame { panel7.setBackground(Color.BLACK); cP.add(panel7); + + panel8 = new JPanel(); + panel8.setBounds(400, 100, 100, 100); + panel8.setVisible(true); + panel8.setBackground(Color.BLUE); + + cP.add(panel8); } public JPanel getPanel1() {