public void paintClock(){ Graphics g = getGraphics(); g.setFont(new java.awt.Font("Verdana", 1, 12)); g.drawString(" " + cal.get(Calendar.DATE) +"." + (cal.get(Calendar.MONTH)+1) + "." + cal.get(Calendar.YEAR), 20, 50); if (sec < 10) { g.drawString(cal.get(Calendar.HOUR_OF_DAY) + ":" + cal.get(Calendar.MINUTE) + ":" + "0" + cal.get(Calendar.SECOND), 20, 80); } else { g.drawString(cal.get(Calendar.HOUR_OF_DAY) + ":" + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND), 20, 80); } repaint(); }