Mercurial > hg > pub > prymula > com
diff kopieckreta/src/StartScreen.java @ 0:2787f5e749ae
INIT
author | prymula <prymula76@outlook.com> |
---|---|
date | Thu, 21 Sep 2023 22:33:57 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kopieckreta/src/StartScreen.java Thu Sep 21 22:33:57 2023 +0200 @@ -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); + } +}