From 5ba141396d3cc0e7278c4776c907fada6c2a0400 Mon Sep 17 00:00:00 2001 From: Sebastian Kacza Date: Fri, 8 Jan 2021 14:10:50 +0100 Subject: [PATCH 1/2] Texturen Gui angelegt --- src/de/jaujau/gui/texturenauswaehlen_GUI.java | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/de/jaujau/gui/texturenauswaehlen_GUI.java b/src/de/jaujau/gui/texturenauswaehlen_GUI.java index 77dd22a..05ce0e4 100644 --- a/src/de/jaujau/gui/texturenauswaehlen_GUI.java +++ b/src/de/jaujau/gui/texturenauswaehlen_GUI.java @@ -1,31 +1,37 @@ package de.jaujau.gui; +import java.awt.BorderLayout; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; + +import de.jaujau.daten.Texturenpakete; + /** - * Class texturenauswaehlen_GUI + * Klasse texturenauswaehlen_GUI */ -public class texturenauswaehlen_GUI { +public class texturenauswaehlen_GUI extends JFrame{ - // - // Fields - // + private static final long serialVersionUID = 1L; + private JPanel contentPane; + private Texturenpakete pakete; + + public texturenauswaehlen_GUI (Texturenpakete texturenpakete) { + pakete = texturenpakete; + erstelleFenster(); + } + + private void erstelleFenster() { + setAlwaysOnTop(true); + setBounds(100, 100, 588, 382); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + contentPane.setLayout(new BorderLayout(0, 0)); + setContentPane(contentPane); + } - // - // Constructors - // - public texturenauswaehlen_GUI () { }; - - // - // Methods - // - - - // - // Accessor methods - // - - // - // Other methods - // + } From dda8646af511dba96b83cbfaa751df524465ac2d Mon Sep 17 00:00:00 2001 From: ekresse Date: Fri, 8 Jan 2021 14:11:57 +0100 Subject: [PATCH 2/2] Update Texturenauswahl --- src/de/jaujau/gui/Dashboard_GUI.java | 4 ++++ src/de/jaujau/gui/GUI.java | 23 ++++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/de/jaujau/gui/Dashboard_GUI.java b/src/de/jaujau/gui/Dashboard_GUI.java index 281a64d..ccb7efa 100644 --- a/src/de/jaujau/gui/Dashboard_GUI.java +++ b/src/de/jaujau/gui/Dashboard_GUI.java @@ -254,6 +254,10 @@ public class Dashboard_GUI extends JPanel{ showwunsch(false); aussetzen.setVisible(false); aktuellesSpiel.spiel(this); + player_hand.setVisible(true); + label_final.setVisible(false); + ablagestapel.setVisible(true); + rechts.setVisible(true); aktualisiereGUI(); } diff --git a/src/de/jaujau/gui/GUI.java b/src/de/jaujau/gui/GUI.java index b255ba7..293cf67 100644 --- a/src/de/jaujau/gui/GUI.java +++ b/src/de/jaujau/gui/GUI.java @@ -113,6 +113,14 @@ public class GUI extends JFrame{ gamelabel.setBounds(0, 91, 220, 29); menuhide.add(gamelabel); + JLabel texturenlabel = new JLabel("Texturen"); + + texturenlabel.setHorizontalAlignment(SwingConstants.CENTER); + texturenlabel.setForeground(Color.WHITE); + texturenlabel.setFont(new Font("Tahoma", Font.PLAIN, 24)); + texturenlabel.setBounds(0, 131, 220, 29); + menuhide.add(texturenlabel); + JPanel dashboard = new JPanel(); dashboard.setBackground(new Color(73, 128, 242)); getContentPane().add(dashboard, BorderLayout.CENTER); @@ -181,10 +189,15 @@ public class GUI extends JFrame{ } }); + + + texturenlabel.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + texturenauswaehlen_GUI texturenauswahl = new texturenauswaehlen_GUI(texturenpakete); + texturenauswahl.setVisible(true); + } + }); + } - - - - - }