Calendar myCal = Calendar.getInstance();
StringBuffer sb = new StringBuffer();
sb.append(tf.format(myCal.get(Calendar.HOUR)));
sb.append(':");
sb.append(tflz.format(myCal.get(Calendar.MINUTE)));
sb.append(':");
sb.append(tflz.format(myCal.get(Calendar.SECOND)));
String s = sb.toString();
FontMetrics fm = getFontMetrics(getFont());
int x = (getSize().width - fm.stringWidth(s))/2;
// System.out.println("Size is " + getSize());
g.drawString(s, x, 10);