Panel.java 844 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 Panel extends JPanel implements ActionListener, ButtonListener, JoyStickListener{
  9. Timer t;
  10. public Panel()
  11. {
  12. //addButtonListener(this);
  13. t = new Timer(1000/30, this);
  14. t.start();
  15. }
  16. public void actionPerformed(ActionEvent arg0) {
  17. repaint();
  18. }
  19. public void paintComponent(Graphics g)
  20. {
  21. super.paintComponent(g);
  22. Graphics2D g2d = (Graphics2D) g;
  23. }
  24. @Override
  25. public void buttonPressed() {
  26. // TODO Auto-generated method stub
  27. }
  28. @Override
  29. public void buttonReleased() {
  30. // TODO Auto-generated method stub
  31. }
  32. @Override
  33. public void onJoyStickMoved() {
  34. // TODO Auto-generated method stub
  35. }
  36. }