Advertisement
Guest User

StackoverflowHelp

a guest
Sep 4th, 2011
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. public class DrawPanel extends JPanel implements Serializable {
  2.  
  3. private static final long serialVersionUID = -3263393448574868713L;
  4.  
  5. /** Our panel info painter */
  6. private PlayerInfoPanel panelPainter;
  7.  
  8. /**Our player object */
  9. private final PlayerCharacter player;
  10.  
  11. /** The dimensions of each tile */
  12. public static final int TILE_SIZE = 32;
  13.  
  14.  
  15. /**
  16. * Constructor for dis bitch
  17. * @param strategy Containing parent's buffer strategy
  18. */
  19. public DrawPanel(PlayerCharacter player) {
  20. this.player = player;
  21.  
  22. }
  23.  
  24. @Override
  25. public void paint(Graphics g) {
  26. super.paint(g);
  27. g.drawString(String.valueOf(System.currentTimeMillis()), 100, 100);
  28. g.dispose();
  29. }
  30. }
  31.  
  32.  
  33.  
  34. -------------------------------------------------------------------------
  35.  
  36. A portion of my initialization class, the part that handles the drawing.
  37.  
  38. EventQueue.invokeLater(new Runnable() {
  39. public void run() {
  40. introGui.setEnabled(false);
  41. introGui.setVisible(false);
  42.  
  43. mainGui = new MainGui();
  44. mainGui.setVisible(true);
  45. mainGui.login();
  46.  
  47. drawPanel = mainGui.getDrawPanel();
  48. }
  49. });
  50.  
  51. while(true) {
  52. if (mainGui != null) {
  53. drawPanel.repaint();
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement