fre024 Posted June 9, 2014 Posted June 9, 2014 (edited) SOLVED I use this method, but it won't paint a thing on the client. public void onPaint(Graphics g) { long millis = System.currentTimeMillis() - /* this.variables. */startTime; long hours = millis / 3600000L; millis -= hours * 3600000L; long minutes = millis / 60000L; millis -= minutes * 60000L; long seconds = millis / 1000L; // DateFormat df = new SimpleDateFormat("mm:ss"); g.setColor(Color.WHITE); g.setFont(new Font("Arial", Font.BOLD, 15)); g.drawString("Main script state: " + (mainState), 150, 20); g.setColor(Color.ORANGE); g.setFont(new Font("Arial", Font.PLAIN, 12)); g.drawString("Sub script state: " + (subState), 25, 35); g.drawString("Time running: " + (hours + ":" + minutes + ":" + seconds), 25, 50); } Edited June 10, 2014 by fre024
Apaec Posted June 9, 2014 Posted June 9, 2014 I use this method, but it won't paint a thing on the client. public void onPaint(Graphics g) { long millis = System.currentTimeMillis() - /* this.variables. */startTime; long hours = millis / 3600000L; millis -= hours * 3600000L; long minutes = millis / 60000L; millis -= minutes * 60000L; long seconds = millis / 1000L; // DateFormat df = new SimpleDateFormat("mm:ss"); g.setColor(Color.WHITE); g.setFont(new Font("Arial", Font.BOLD, 15)); g.drawString("Main script state: " + (mainState), 150, 20); g.setColor(Color.ORANGE); g.setFont(new Font("Arial", Font.PLAIN, 12)); g.drawString("Sub script state: " + (subState), 25, 35); g.drawString("Time running: " + (hours + ":" + minutes + ":" + seconds), 25, 50); } As was said above, change what you have to this: public void onPaint(Graphics2D g) { long millis = System.currentTimeMillis() - /* this.variables. */startTime; long hours = millis / 3600000L; millis -= hours * 3600000L; long minutes = millis / 60000L; millis -= minutes * 60000L; long seconds = millis / 1000L; // DateFormat df = new SimpleDateFormat("mm:ss"); g.setColor(Color.WHITE); g.setFont(new Font("Arial", Font.BOLD, 15)); g.drawString("Main script state: " + (mainState), 150, 20); g.setColor(Color.ORANGE); g.setFont(new Font("Arial", Font.PLAIN, 12)); g.drawString("Sub script state: " + (subState), 25, 35); g.drawString("Time running: " + (hours + ":" + minutes + ":" + seconds), 25, 50); }