Este artículo presenta el reloj de simulación dinámica usando JFRE, dibuje relojes en el panel y extraiga el sistema en el momento actual.
Implementar código de la siguiente manera
Import javax.swing.*; Hora; ;} Public int getSecond () {return Second;} // Dibuja el reloj Protectd Void PaintComponent (Graphics G) {Super. gethight ()) * 0.8 * 0.5); -ClockRadius, 2 * Clockradius, 2 * Clockradius); G.DrawString ("3", XCenter + ClockRadius -10, YCenter + 3); * 0. 8); segundo * (2 * Math.pi /60)); 0.65); 2 * Math.pi / 60)); int xhour = (int) (int) (xcenter + hlength * Math.sin minuto / 60.0) * (2 * Math.pi / 12)); Xhour, yhour); GetMinute ()) + ": + S.Format (getSecond)), xcenter -22, ycenter -clockradius -15);} public void setCurrentTime () {calendar calendar = new Gregoriancalendar (); this.hour = calendar.get ( Calen dar.hour_of_dy); Stub jframe fra me = new Jframe ("DiaPlayClock"); True) {StillClock Reloj = New StillClock (); {E.PrintStackTrace ();} Reloj.Mapa de efecto:
Lo anterior es todo el contenido de este artículo.