Mercurial > hg > pub > prymula > com
comparison kopieckreta/src/StartScreen.java @ 0:2787f5e749ae
INIT
author | prymula <prymula76@outlook.com> |
---|---|
date | Thu, 21 Sep 2023 22:33:57 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:2787f5e749ae |
---|---|
1 | |
2 package src; | |
3 | |
4 /** | |
5 * | |
6 * @author przem | |
7 */ | |
8 import java.awt.*; | |
9 import javax.swing.JPanel; | |
10 import java.awt.image.BufferedImage; | |
11 import java.io.IOException; | |
12 import javax.imageio.ImageIO; | |
13 | |
14 public class StartScreen extends JPanel{ | |
15 private BufferedImage image; | |
16 | |
17 public StartScreen() { | |
18 this.repaint(); | |
19 try { | |
20 image = ImageIO.read(getClass().getResourceAsStream("/startscreen.jpg")); | |
21 } catch (IOException ioe) { | |
22 ioe.printStackTrace(); | |
23 } | |
24 } | |
25 protected void paintComponent(Graphics g){ | |
26 super.paintComponent(g); | |
27 | |
28 g.drawImage(image, 0,0,this); | |
29 } | |
30 } |