Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pack1;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- import javax.imageio.ImageIO;
- import javax.swing.ImageIcon;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- public class Var {
- static JFrame jf1;
- static int screenwidth = 800, screenheight = 600;
- static int backgroundY1 = 0, backgroundY2 = -600;
- static boolean moveup = false, movedown = false, moveright = false, moveleft = false;
- static Label lbl1;
- static BufferedImage ib1, ib2;
- public Var() {
- try {
- // Background
- ib1 = ImageIO.read(new File("rsc/b1.jpg"));
- ib2 = ImageIO.read(new File("rsc/b1.jpg"));
- } catch (IOException e) {
- e.printStackTrace();
- System.out.println("Bild konnte nicht geladen werden");
- }
- jf1 = new JFrame();
- jf1.setVisible(true);
- jf1.add(new Label(new ImageIcon(ib1)));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment