Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Graphics;
- import java.awt.image.BufferedImage;
- import javax.swing.JPanel;
- public class BackgroundPanel extends JPanel{
- BufferedImage backgroundImage;
- GUIFrame window = null;
- public BackgroundPanel(BufferedImage image, GUIFrame windowFrame){
- backgroundImage = image;
- window = windowFrame;
- }
- @Override
- public void paintComponent(Graphics g){
- super.paintComponents(g);
- this.setVisible(true);
- g.drawImage(backgroundImage, 0, 0, window.getWidth(), window.getHeight(), null);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement