view kopieckreta/src/StartScreen.java @ 16:8fa14e28f099

flappyufo-spec fix
author Przemyslaw <prymula76@outlook.com>
date Sat, 24 Feb 2024 17:25:30 +0100
parents 2787f5e749ae
children
line wrap: on
line source


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);
    }
}