From 491342cdd6e842cf2c864fd0146d5dac1ce542b2 Mon Sep 17 00:00:00 2001 From: Yazan Alaamer Date: Thu, 19 Jan 2023 16:11:58 +0100 Subject: [PATCH] added name game and start button --- src/main/java/game/StartDarkSoulsGame.java | 28 +++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/main/java/game/StartDarkSoulsGame.java b/src/main/java/game/StartDarkSoulsGame.java index c1d74ec..2a5c846 100644 --- a/src/main/java/game/StartDarkSoulsGame.java +++ b/src/main/java/game/StartDarkSoulsGame.java @@ -15,8 +15,11 @@ import javax.swing.JLabel; public class StartDarkSoulsGame { JPanel titleNamePanel; JLabel titelNameLabel; + JPanel StartButtonPanel; Font titelFont = new Font("Times new Roma", Font.PLAIN, 90); + JButton startButton; // commit (5) create start button Container con; + public StartDarkSoulsGame() { gui.Frame.setSize(800, 600); gui.Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -24,12 +27,25 @@ public class StartDarkSoulsGame { gui.Frame.setLayout(null); gui.Frame.setVisible(true); con = gui.Frame.getContentPane(); - titleNamePanel = new JPanel(); // commit 2 - titleNamePanel.setBounds(100,100,600, 150); // commit 2 - titleNamePanel.setBackground(Color.black); // commit 2 - titelNameLabel = new JLabel("Dark souls 4 "); // commit 2 - titelNameLabel.setForeground(Color.white); // comiit 2 - titelNameLabel.setFont(titelFont); // commit 2 + titleNamePanel = new JPanel(); + titleNamePanel.setBounds(100,100,600, 150); + titleNamePanel.setBackground(Color.black); + titelNameLabel = new JLabel("Dark souls 4 "); + titelNameLabel.setForeground(Color.white); + titelNameLabel.setFont(titelFont); + StartButtonPanel = new JPanel (); + StartButtonPanel.setBounds(300, 400, 200, 100); + StartButtonPanel.setBackground(Color.black); + + startButton = new JButton("START"); + startButton.setBackground(Color.black); + startButton.setForeground(Color.white); + + titleNamePanel.add(titelNameLabel); + StartButtonPanel.add(startButton); + + con.add(titleNamePanel); + con.add(StartButtonPanel); // commit 4 create start button panel } }