Reminder software [send to her] -- if it takes a long time to work, remind me to take a break. You can set the rest duration in seconds.

Source: Internet
Author: User

This is a work-time reminder software. It only implements the reminder part. When the program is started, a large background will appear, covering the entire desktop and performing timing operations, remind you to take a rest. You can set the rest duration in config. properties, in seconds. When the reminder time is reached, the close button will be set off. You can close it now.

Of course, you really want to close something like this, and no software can work, you know.

Just as a kind of goodwill reminder, the role is relative, there is no absolute.

This software requires you to first install JDK and configure it correctly, and then set a scheduled task in windows. You can set it to run once every hour or once every few hours, depends on your own situation.

Http://article.pchome.net/content-1495102.html

Http://blog.csdn.net/usherhll/article/details/6681205

Configure the scheduled task according to the preceding content.

The subject code is as follows:

 

Package love; import Java. AWT. color; import Java. AWT. dimension; import Java. AWT. font; import Java. AWT. gridlayout; import Java. AWT. toolkit; import Java. AWT. event. actionevent; import Java. AWT. event. actionlistener; import Java. util. date; import javax. swing. *; public class mainframe {Private Static jframe frame = new jframe (""); Private Static jlabel info = new jlabel ("", jlabel. center); Private Static int width = (INT) (Toolkit. getdefatooltoolkit (). getscreensize (). getwidth (); Private Static int Height = (INT) (Toolkit. getdefatooltoolkit (). getscreensize (). getheight (); Private Static Font font = new font ("", Font. bold, 60); Private Static jbutton = new jbutton ("close"); Private Static jlabel time = new jlabel ("", jlabel. center); public static void run () {// todo auto-generated method stubframe. setlayout (New Gridlayout (3, 1); // hide the title bar frame. setundecorated (true); frame. getrootpane (). setwindowdecorationstyle (jrootpane. none); info. setforeground (color. red); info. settext (util. shownow (new date (); info. setfont (font); time. setforeground (color. red); time. setfont (font); button. setfont (font); button. setborderpainted (false); button. setborder (borderfactory. createraisedbevelborder (); dimension preferredsize = new dimensio N (100, 50); // sets the size of the button. setpreferredsize (preferredsize); frame. add (Info); frame. add (time); frame. add (button); button. setenabled (false); int COUNT = integer. parseint (util. get ("resttime"); frame. setvisible (true); frame. setlocation (0, 0); frame. setsize (width, height); frame. setresizable (false); int I = 0; while (count> = 0) {If (count % 5 = 0) {info. settext ("Now Beijing time:" + util. shownow (new date ();} Try {thread. slee P (1000); count --; I ++; time. settext (I + "seconds passed");} catch (interruptedexception e) {e. printstacktrace () ;}}if (count <= 0) {button. setenabled (true); time. settext (util. get ("resttime") + "the rest time is over. You can choose to work now! O (operator _ operator) O "); button. addactionlistener (New actionlistener () {@ overridepublic void actionreceivmed (actionevent e) {// todo auto-generated method stubsystem. exit (0 );}});}}}

Thank you for your support!

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.