Guest User

Untitled

a guest
May 26th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. package de.ilp.schulung.huhn;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Cursor;
  5. import java.awt.Graphics;
  6. import java.awt.Graphics2D;
  7. import java.awt.Image;
  8. import java.awt.Point;
  9. import java.awt.Toolkit;
  10.  
  11. import javax.swing.ImageIcon;
  12. import javax.swing.JFrame;
  13. import javax.swing.JPanel;
  14.  
  15. public class Screen extends JPanel {
  16.  
  17. public static void main(String[] args) {
  18. JFrame frame = new JFrame("VengHuhn");
  19.  
  20. frame.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
  21.  
  22. frame.setSize(1600, 800);
  23. frame.add(new Screen());
  24. frame.setVisible(true);
  25. }
  26.  
  27. public void paintComponent(Graphics g) {
  28. super.paintComponent(g);
  29.  
  30. ImageIcon bg = new ImageIcon(this.getClass().getResource("bg.jpg"));
  31. Image ball = bg.getImage();
  32. Graphics2D g2d = (Graphics2D) g;
  33. g2d.drawImage(ball, 0, 0, 1600, 800, null);
  34.  
  35. }
  36.  
  37. public void move(int delay, Image pic, int range, Graphics g) {
  38.  
  39. }
  40.  
  41. }
Add Comment
Please, Sign In to add comment