From d8afc9f5c2aa97a96ca326c0178a7fc9577afaaf Mon Sep 17 00:00:00 2001 From: Przemyslaw Date: Mon, 1 Apr 2024 09:02:22 +0200 Subject: Init --- src/StartScreen.java | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/StartScreen.java (limited to 'src/StartScreen.java') diff --git a/src/StartScreen.java b/src/StartScreen.java new file mode 100644 index 0000000..d0030c1 --- /dev/null +++ b/src/StartScreen.java @@ -0,0 +1,30 @@ + +package src; + +/** + * + * @author przem + */ +import java.awt.*; +import javax.swing.JPanel; +import java.awt.image.BufferedImage; +import java.io.IOException; +import javax.imageio.ImageIO; + +public class StartScreen extends JPanel{ + private BufferedImage image; + + public StartScreen() { + this.repaint(); + try { + image = ImageIO.read(getClass().getResourceAsStream("/startscreen.jpg")); + } catch (IOException ioe) { + ioe.printStackTrace(); + } + } + protected void paintComponent(Graphics g){ + super.paintComponent(g); + + g.drawImage(image, 0,0,this); + } +} -- cgit v1.2.3