annotate kopieckreta/src/StartScreen.java @ 9:cdadbf30a821

arkanoid-0.7-1_PKG
author prymula <prymula76@outlook.com>
date Sun, 04 Feb 2024 15:47:05 +0100
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 }