From eb8ad60e786308a569899260e2759899feba6ac1 Mon Sep 17 00:00:00 2001 From: Yazan Alaamer Date: Thu, 19 Jan 2023 16:38:55 +0100 Subject: [PATCH] create main text area --- src/main/java/game/StartDarkSoulsGame.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/game/StartDarkSoulsGame.java b/src/main/java/game/StartDarkSoulsGame.java index 687e53a..48221b5 100644 --- a/src/main/java/game/StartDarkSoulsGame.java +++ b/src/main/java/game/StartDarkSoulsGame.java @@ -16,9 +16,11 @@ public class StartDarkSoulsGame { JPanel titleNamePanel; JLabel titelNameLabel; JPanel StartButtonPanel; - JPanel mainTextPanel; // comit (7) create maintextpanel - Font titelFont = new Font("Times new Roma", Font.PLAIN, 90); - JButton startButton; // commit (5) create start button + JPanel mainTextPanel; + JTextArea mainTextArea; + Font titelFont = new Font("Times new Roman", Font.PLAIN, 90); + Font normalFont = new Font ("Times new Roman", Font.PLAIN, 28); + JButton startButton; Container con; public StartDarkSoulsGame() { @@ -54,5 +56,13 @@ public class StartDarkSoulsGame { mainTextPanel.setBounds(100, 100, 600,250); mainTextPanel.setBackground(Color.red); con.add(mainTextPanel); + + mainTextArea = new JTextArea("Main Text Area"); + mainTextArea.setBounds( 100,100,600,250); + mainTextArea.setBackground(Color.black); + mainTextArea.setForeground(Color.white); + mainTextArea.setFont(normalFont); + mainTextArea.setLineWrap(true); + mainTextPanel.add(mainTextArea); } }