String timeStr = clock.getTimeString();
Font timeFont = getTimeFont(g);
g.setFont(timeFont);
FontMetrics timeFontMetric = g.getFontMetrics();
Rectangle2D timeStrBounds = timeFontMetric.getStringBounds(timeStr, g);
int timeStrWidth = (int)timeStrBounds.getWidth();
int timeStrHeight = (int)timeStrBounds.getHeight();
int timeStrX = (winWidth-timeStrWidth)/2;
int timeStrY = (winHeight+timeStrHeight)/2;
int timeStrOffset = timeStrHeight/8/2;
g.drawString(
timeStr,
timeStrX,
timeStrY);
//// Date String ////
String dateStr = clock.getDateString();
Font dateFont = getDateFont(g);
g.setFont(dateFont);
FontMetrics dateFontMetric = g.getFontMetrics();
Rectangle2D dateStrBounds = dateFontMetric.getStringBounds(dateStr, g);
g.drawString(
dateStr,
(winWidth-(int)dateStrBounds.getWidth())/2,
timeStrY-timeStrHeight-timeStrOffset);