Atitit. implementation of the system tray icon java Swing C #. NET C + + JS
1. Structure of the system tray icon 1
2. implementation of Java swing 1
3.. NET Implementation 1
4. implementation of C + + 1
5. Web JS HTML Implementation 2
6.----Code 2
7. Regular monitoring, every time when the reminder 2
8. Reference 3
1. Structure of the system tray icon
Create tray icon,
Dynamic icon constantly flashing ... This walk to use a timer to realize LAN.
With right-click menu (Show main interface, options, about this software, about author, exit)
ToolTip
Add a timed monitor, and every time you remind
Author:: Old Wow's paw attilax Ayron, email:[email protected]
Reprint please indicate source: Http://blog.csdn.net/attilax
2. Java Swingthe implementation
Systrayx Tray=new systrayx ( path," Information publisher", Popmenu);
. atibrow
3.. netthe implementation
See reference
4. C + +the implementation
See reference
5. Web JS HTMLthe implementation
Js can be implemented via plugins. aplet , etc...
6.----Code
Public Static void Main (string[] args) {
if (Systemtray.issupported ()) {//determine if the current platform supports the system tray
St = Systemtray.getsystemtray ();
Image Image = Toolkit.getdefaulttoolkit (). GetImage (
Appico. class. GetResource ("/com/attilax/ico/ati.png")); //Define a picture of the tray icon
CreatePopupMenu ();
TrayIcon ti = new trayicon (image, "Desktop Demo Tray", pm);
Try {
St.Add (ti);
} Catch (Awtexception ex) {
ex. Printstacktrace ();
}
}
}
7.timed monitoring, every time to remind
1. //Add a timed monitor, every time to remind
2. Try
3. {
4. Java.util.Timer Timer = new java.util.Timer ();
5. Timer.schedule (new timertask () {
6. public void run () {
7. String eet="2012-08-28 17:39:30";
8. String str=thistime (). Replace ("-",""). Replace (":",""). Replace ("" " ,"");
9. String Str1=eet.replace ("-",""). Replace (":",""). Replace (""," ");
Et=integer.parseint int (str.substring (4));
One. int et1=integer.parseint (str1.substring (4));
int t=0;
if(et1-et<=0)
14. {
t++;
if(t<2)
17. {
Trayicon.displaymessage ("Warning", "This is a warning prompt!", TrayIcon.MessageType.WARNING);
19.}
20.}
21.}
0, +);
//End of monitoring
24.}
catch(Exception ex)
26. {
System.out.println ("Timer exception");
28.}
29.}
8. Reference
Paip. enhance the user experience ------C + + Qt5 Implement program icon and dynamic tray flashing icon - Push Cool . htm
Paip.c#.net tray icon Build and use summary -attilax column - Blog channel -CSDN.NET.htm
Java Swing System tray Usage - inner peace , everything. The mindset determines my success. 2013-05-01 determined. The turning point of 2014-05-11 life - Blog channel -CSDN.NET.htm
Atitit. System tray Icon Design Java Swing C #. NET C + + JS