GameView.java 523 B

123456789101112131415161718192021222324252627282930
  1. package view;
  2. import java.awt.Graphics;
  3. import java.awt.Graphics2D;
  4. import java.awt.event.ActionEvent;
  5. import java.awt.event.ActionListener;
  6. import javax.swing.JPanel;
  7. import javax.swing.Timer;
  8. public class GameView extends JPanel implements ActionListener{
  9. Timer t;
  10. public GameView()
  11. {
  12. t = new Timer(1000/30, this);
  13. t.start();
  14. }
  15. public void actionPerformed(ActionEvent arg0) {
  16. repaint();
  17. }
  18. public void paintComponent(Graphics g)
  19. {
  20. super.paintComponent(g);
  21. Graphics2D g2d = (Graphics2D) g;
  22. }
  23. }