Jump to content

onPain() issue


fre024

Recommended Posts

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 by fre024
Link to comment
Share on other sites

 

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);


}
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...