annotate kopieckreta/src/StartScreen.java @ 21:bef3b1af6326

trix - package for arch
author Przemyslaw <prymula76@outlook.com>
date Sun, 31 Mar 2024 22:14:33 +0200
parents 2787f5e749ae
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
prymula <prymula76@outlook.com>
parents:
diff changeset
1
prymula <prymula76@outlook.com>
parents:
diff changeset
2 package src;
prymula <prymula76@outlook.com>
parents:
diff changeset
3
prymula <prymula76@outlook.com>
parents:
diff changeset
4 /**
prymula <prymula76@outlook.com>
parents:
diff changeset
5 *
prymula <prymula76@outlook.com>
parents:
diff changeset
6 * @author przem
prymula <prymula76@outlook.com>
parents:
diff changeset
7 */
prymula <prymula76@outlook.com>
parents:
diff changeset
8 import java.awt.*;
prymula <prymula76@outlook.com>
parents:
diff changeset
9 import javax.swing.JPanel;
prymula <prymula76@outlook.com>
parents:
diff changeset
10 import java.awt.image.BufferedImage;
prymula <prymula76@outlook.com>
parents:
diff changeset
11 import java.io.IOException;
prymula <prymula76@outlook.com>
parents:
diff changeset
12 import javax.imageio.ImageIO;
prymula <prymula76@outlook.com>
parents:
diff changeset
13
prymula <prymula76@outlook.com>
parents:
diff changeset
14 public class StartScreen extends JPanel{
prymula <prymula76@outlook.com>
parents:
diff changeset
15 private BufferedImage image;
prymula <prymula76@outlook.com>
parents:
diff changeset
16
prymula <prymula76@outlook.com>
parents:
diff changeset
17 public StartScreen() {
prymula <prymula76@outlook.com>
parents:
diff changeset
18 this.repaint();
prymula <prymula76@outlook.com>
parents:
diff changeset
19 try {
prymula <prymula76@outlook.com>
parents:
diff changeset
20 image = ImageIO.read(getClass().getResourceAsStream("/startscreen.jpg"));
prymula <prymula76@outlook.com>
parents:
diff changeset
21 } catch (IOException ioe) {
prymula <prymula76@outlook.com>
parents:
diff changeset
22 ioe.printStackTrace();
prymula <prymula76@outlook.com>
parents:
diff changeset
23 }
prymula <prymula76@outlook.com>
parents:
diff changeset
24 }
prymula <prymula76@outlook.com>
parents:
diff changeset
25 protected void paintComponent(Graphics g){
prymula <prymula76@outlook.com>
parents:
diff changeset
26 super.paintComponent(g);
prymula <prymula76@outlook.com>
parents:
diff changeset
27
prymula <prymula76@outlook.com>
parents:
diff changeset
28 g.drawImage(image, 0,0,this);
prymula <prymula76@outlook.com>
parents:
diff changeset
29 }
prymula <prymula76@outlook.com>
parents:
diff changeset
30 }