From 46567375901ed7fb25414cae7d308706cd426f35 Mon Sep 17 00:00:00 2001 From: hugh5 Date: Fri, 28 Oct 2022 21:54:44 +1000 Subject: [PATCH] initial commit --- .gitignore | 3 +++ src/Launcher.java | 14 ++++++++++++++ src/MainWindow.java | 17 +++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 src/Launcher.java create mode 100644 src/MainWindow.java diff --git a/.gitignore b/.gitignore index e69de29..4511c9c 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +out/ +*.iml \ No newline at end of file diff --git a/src/Launcher.java b/src/Launcher.java new file mode 100644 index 0000000..b3463c3 --- /dev/null +++ b/src/Launcher.java @@ -0,0 +1,14 @@ +import javax.swing.*; + +public class Launcher { + + public static void main(String[] args) { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + MainWindow main = new MainWindow(); + main.show(); + } + }); + } +} diff --git a/src/MainWindow.java b/src/MainWindow.java new file mode 100644 index 0000000..48fea17 --- /dev/null +++ b/src/MainWindow.java @@ -0,0 +1,17 @@ +import javax.swing.*; + +public class MainWindow { + private JFrame window; + + public MainWindow() { + window = new JFrame(); + window.setTitle("Tetris"); + window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + window.setSize(800, 500); + window.setLocationRelativeTo(null); + } + + public void show() { + window.setVisible(true); + } +}