Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DrawPanel extends JPanel implements Serializable {
- private static final long serialVersionUID = -3263393448574868713L;
- /** Our panel info painter */
- private PlayerInfoPanel panelPainter;
- /**Our player object */
- private final PlayerCharacter player;
- /** The dimensions of each tile */
- public static final int TILE_SIZE = 32;
- /**
- * Constructor for dis bitch
- * @param strategy Containing parent's buffer strategy
- */
- public DrawPanel(PlayerCharacter player) {
- this.player = player;
- }
- @Override
- public void paint(Graphics g) {
- super.paint(g);
- g.drawString(String.valueOf(System.currentTimeMillis()), 100, 100);
- g.dispose();
- }
- }
- -------------------------------------------------------------------------
- A portion of my initialization class, the part that handles the drawing.
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- introGui.setEnabled(false);
- introGui.setVisible(false);
- mainGui = new MainGui();
- mainGui.setVisible(true);
- mainGui.login();
- drawPanel = mainGui.getDrawPanel();
- }
- });
- while(true) {
- if (mainGui != null) {
- drawPanel.repaint();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement