Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java SE6 ϵͳÍÐÅÌСӦÓùþ

 /**
* @(#)MyTray.java
*
*
* @author Xie Xiaojin
* @version 1.00 2009/11/9
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MyTray implements ActionListener {
private MenuItem item1;
private MenuItem item2;
private MenuItem item3;
private String tip = "лС½øÓÚ\n2009Äê11ÔÂ9ÈÕ\nÁ賿2£º52";
public MyTray(){
if(SystemTray.isSupported()){
SystemTray tray = SystemTray.getSystemTray();
PopupMenu popup = new PopupMenu();
item1 = new MenuItem("ÎҵIJ˵¥");
item2 = new MenuItem("¹ØÓÚ");
item3 = new MenuItem("Í˳ö");
item2.addActionListener(this);
item3.addActionListener(this);
popup.add(item1);
popup.add(item2);
popup.add(item3);
TrayIcon icon = new TrayIcon(getIcon("rss.png").getImage(), tip, popup);
icon.displayMessage("ϵͳÌáʾ", tip, TrayIcon.MessageType.INFO);
try{
tray.add(icon);
} catch(AWTException ex){
System.err.println("ÎÞ·¨ÏòÕâ¸öÍÐÅÌÌí¼Óв˵¥Ïî");
}
} else{
System.out.println("ÎÞ·¨Ê¹ÓÃϵͳÍÐÅÌ");
}
}
public static void main(String[] args){
new MyTray();
}
public ImageIcon getIcon(String url){
return new ImageIcon(getClass().getResource(url));
}
public void actionPerformed(ActionEvent e){
if(e.getSource() == item2){
JFrame f = new JFrame("ϵͳÍÐÅÌ");
JLabel label = new JLabel(tip);
f.getContentPane().add(label);
f.setSize(300, 200);
f.setLocationRelativeTo(null);
f.setVisible(true);
}
if(e.getSource() == item3){
System.exit(0);
}
}
}


Ïà¹ØÎĵµ£º

javaÈëÃÅ

 Javaѧϰ´ÓÈëÃŵ½¾«Í¨ 
Ò»¡¢ JDK (Java Development Kit) 
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......

Thinking In Java Notes

1. ¶ÔÓÚÒ»¸östatic·½·¨¶øÑÔ£¬ÎÞ·¨·ÃÎÊ·ºÐÍÀàµÄÀàÐͲÎÊý£¬ËùÒÔ£¬Èç¹ûstatic·½·¨ÐèҪʹÓ÷ºÐÍÄÜÁ¦£¬¾Í±ØÐëʹÆä³ÉΪ·ºÐÍ·½·¨¡£
2. µ±Ê¹Ó÷ºÐÍÀàʱ£¬±ØÐëÔÚ´´½¨¶ÔÏóµÄʱºòÖƶ¨ÀàÐͲÎÊýµÄÖµ£¬¶øÊÇÓ÷ºÐÍ·½·¨µÄʱºò£¬Í¨³£²»±ØÖ¸¶¨²ÎÊýÀàÐÍ£¬ÒòΪ±àÒëÆ÷»áΪÎÒÃÇÕÒ³ö¾ßÌåµÄÀàÐÍ¡£Õâ³ÆΪÀàÐͲÎÊýÍƶϡ£ ......

java¶ÑÕ»

       1. Õ»(stack)Óë¶Ñ(heap)¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
¡¡¡¡2. Õ»µÄÓÅÊÆÊÇ£¬´æÈ¡ËٶȱȶÑÒª¿ì£¬½ö´ÎÓÚÖ±½ÓλÓÚCPUÖеļĴæÆ÷¡£µ«È±µãÊÇ£¬´æÔÚÕ»ÖеÄÊý¾Ý´óСÓëÉú´æÆÚ±ØÐëÊÇÈ·¶¨µÄ£¬È±·¦Áé»îÐÔ¡£ÁíÍ⣬ջÊý¾Ý¿ÉÒÔ¹ ......

JavaµÄdz¿½±´ºÍÉ±´(1)

 JavaµÄ¿½±´·ÖΪÉ±´ºÍdz¿½±´
dz¿½±´£º°ÑÒ»¸ö¶ÔÏóÖÐËùÓеķÇstatic³ÉÔ±±äÁ¿(°üÀ¨¶ÔÆäËü¶ÔÏóµÄÒýÓã¬javaÖеÄÒýÓÃÏ൱ÓÚC/C++ÖеÄÖ¸Õë±äÁ¿)¶¼¿½±´Ò»±é£¬¶ø²»¿½±´ÒýÓÃËùÖ¸ÏòµÄ¶ÔÏó
É±´£º°ÑÒ»¸ö¶ÔÏóÖÐËùÓеķÇstatic³ÉÔ±±äÁ¿(°üÀ¨¶ÔÆäËü¶ÔÏóµÄÒýÓÃ)¶¼¿½±´Ò»±é£¬ÒýÓÃËùÖ¸ÏòµÄ¶ÔÏóÒ²¿½±´Ò»·Ý
ÕâƪÎÄÕÂÏȽ²Êödz¿½±´£ ......

javaµÄÄÇЩÊ£ºÊµÏÖѧÉúÐÅϢ¼ÈëºÍ²é¿´

±¾³ÌÐò¿ÉÒÔʵÏÖѧÉúÐÅϢ¼ÈëºÍ²é¿´¡£
ÒªÇó£º
£¨1£©ÀûÓÃSwingÉè¼ÆͼÐÎÓû§½çÃ棬½çÃæ°üÀ¨£ºÑ§ÉúÐÅϢ¼ÈëºÍÏÔʾѧÉúÐÅÏ¢£»
£¨2£©Ìí¼ÓѧÉúÐÅÏ¢£ºÊµÏÖÍù¼¯ºÏÀïÌí¼ÓѧÉúÐÅÏ¢£¨Ñ§ºÅ,ÐÕÃû,ÐԱ𣬳ɼ¨£©
      ×¢Ò⣺Óû§ÊäÈëÐÅÏ¢µÄÑéÖ¤¡£
£¨3£©ÐÞ¸ÄѧÉúÐÅÏ¢£ºÓÉÓû§ÊäÈëѧÉúµÄѧºÅ£¬³ÌÐòÑéÖ¤ÊÇ·ñÓдËѧÉú ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ