From 5c0f7719d4b789be387c9d4e162cbf3062a93318 Mon Sep 17 00:00:00 2001 From: fdai7012 Date: Wed, 17 Jan 2024 15:57:12 +0100 Subject: [PATCH] Created Basic UI --- src/main/java/pacmanGame/Program.java | 28 ++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/main/java/pacmanGame/Program.java b/src/main/java/pacmanGame/Program.java index 5b16707..c4664ee 100644 --- a/src/main/java/pacmanGame/Program.java +++ b/src/main/java/pacmanGame/Program.java @@ -1,8 +1,34 @@ package pacmanGame; +import java.awt.*; +import javax.swing.*; + public class Program { + + public static JTextArea textArea; public static void main(String[] args) { - + createAndShowGUI(); } + + + private static void createAndShowGUI() { + JFrame frame = new JFrame("PacmaaaAAAYYYHAAAaaam"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + frame.setSize(500, 665); + + textArea = new JTextArea("..."); + textArea.setEditable(false); + textArea.setFocusable(false); + textArea.setBackground(Color.black); + textArea.setForeground(Color.blue); + + Font font = new Font("Consolas", Font.PLAIN, 15); + textArea.setFont(font); + + frame.add(textArea, BorderLayout.CENTER); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } }