From d4d81f8763d67cc6aed49f3e978f1c0d538b6eac Mon Sep 17 00:00:00 2001 From: fdai7382 Date: Wed, 25 Jan 2023 10:26:34 +0100 Subject: [PATCH] =?UTF-8?q?[MouseGame=20Class]:=20Hinzuf=C3=BCgen=20der=20?= =?UTF-8?q?Zur=C3=BCcksetz-Fl=C3=A4che=20vom=20Ziel.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JavaGamelauncher/MouseGame.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java index 5fbda60..b325f43 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java @@ -87,20 +87,30 @@ public class MouseGame extends JFrame { nordWand.setBounds(0, 0, 696, 10); panel.add(nordWand); - JPanel ostWand = new JPanel(); - ostWand.setBackground(new Color(0, 0, 0)); - ostWand.setBounds(686, 0, 10, 509); - panel.add(ostWand); - JPanel suedWand = new JPanel(); suedWand.setBackground(new Color(0, 0, 0)); suedWand.setBounds(0, 559, 696, 10); panel.add(suedWand); + JPanel ostWand = new JPanel(); + ostWand.setBackground(new Color(0, 0, 0)); + ostWand.setBounds(686, 0, 10, 509); + panel.add(ostWand); + JPanel westWand = new JPanel(); westWand.setBackground(new Color(0, 0, 0)); westWand.setBounds(0, 60, 10, 509); panel.add(westWand); + + JPanel panel_1 = new JPanel(); + panel_1.setBounds(801, 518, 83, 62); + panel_1.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + robot.mouseMove(200, 170); + } + }); + contentPane.add(panel_1);