²ÉÓÃJAVA×é¼þÏÔʾ±¾µØÍ¼Æ¬
³ÌÐòÉè¼ÆÖо³£»áÅöµ½ÓÃ×é¼þÀ´ÏÔʾͼƬµÄÇé¿ö, ¿ÉÒÔÏÔʾͼƬµÄ×é¼þÓкܶà,Èçawt°üÖеÄbutton,label,panelµÈ¶¼¿ÉÒÔÔÚÆäÉÏÃæ·ÅÖÃͼƬ.ͼƬÓÖ¿É·ÖΪÁ½Àà,Ò»ÀàÊÇ·ÅÖÃÓÚbuttonµÈ×é¼þÉϵÄImageIcon(ͼ±ê),ÁíÒ»ÀàÊÇ¿ÉÒÔ·ÅÖÃÔÚpanelµÈ×é¼þÉϵĽϴóµÄͼƬImage¡£
´Ó±¾µØ¼ÆËã»úÖжÁȡͼƬµÄ·½·¨Ò²Óкܶ࣬±ÈÈ磬ÀûÓÃImageIconÀ´¶ÁÈ¡±¾µØÍ¼Æ¬£¬»¹¿ÉÒ԰ѶÁÈ¡µ½µÄImageIconת»»ÎªImage¡£»¹ÓÐÒ»ÖÖ»ñÈ¡ImageµÄ·½·¨ÊÇÀûÓÃToolkitÀà¡£ÎÒ¸öÈ˽Ïϲ»¶µÚ¶þÖÖ·½·¨£¬Toolkit.getDefaultToolkit().createImage("ͼƬÃû")£»ÒòΪToolkitÀàÊÇÖ±½ÓÓë±¾µØ²Ù×÷ϵͳÏàÁªÏµµÄÒ»¸öÀ࣬»ñÈ¡µ½µÄͼƬ»á¸üÕæÊµ£¬¸üÖ±½Ó¡£
ÏëÒªÓÃJPanelÀ´ÏÔʾ»ñÈ¡µ½µÄͼƬ¾ÍÐèÒªÖØÐ´JPanelÀàµÄpaint(Graphics g)·½·¨£¬¿ÉÒÔÖØÐ´Ò»¸öÀàÀ´extends JpanelÀ࣬Ҳ¿ÉÒÔÔÚ¶¨ÒåJpanelÀàµÄʵÀýʱ²ÉÓÃÄäÃûÀàµÄд·¨À´ÖØÔØpaint()·½·¨¡£
ʾÀýÒ»£º
classImagePanel extends JPanel{
Image image=Toolkit.getDefaultToolkit().createImage("test.jpg")£»
public void paint(Graphics g) {
g.drawImage(image,0,0,image.getWidth(null),image.getHeight(null),null);
}
}
ʾÀý¶þ£º
Image image=Toolkit.getDefaultToolkit().createImage("test.jpg")£»
JPanel panel=new JPanel(){
public void paint(Graphics g){
g.drawImage(image,0,0,imagegetWidth(null),image.getHeight(null),null);
}
};
Ïà¹ØÎĵµ£º
ÀàµÄ³õʼ»¯ºÍ¶ÔÏó³õʼ»¯ÊÇ JVM ¹ÜÀíµÄÀàÐÍÉúÃüÖÜÆÚÖзdz£ÖØÒªµÄÁ½¸ö»·½Ú£¬Google ÁËÒ»±éÍøÂ磬ÓйØÀà×°ÔØ»úÖÆµÄÎÄÕµ¹ÊDz»ÉÙ£¬È»¶øÀà³õʼ»¯ºÍ¶ÔÏó³õʼ»¯µÄÎÄÕ²¢²»¶à£¬ÌرðÊÇ´Ó×Ö½ÚÂëºÍ JVM ²ã´ÎÀ´·ÖÎöµÄÎÄÕ¸üÊÇÏÊÓÐËù¼û¡£
±¾ÎÄÖ÷Òª¶ÔÀàºÍ¶ÔÏó³õʼ»¯È«¹ý³Ì½øÐзÖÎö£¬Í¨¹ýÒ»¸öʵ¼ÊÎÊÌâÒýÈ룬½«Ô´´úÂëת»»³É JVM ×Ö½ÚÂëºó£¬ ......
ÒòΪÏîÄ¿ÓиöÐèÇó£¬ÒªÇóÄܹ»ÔÚij¸öÔ¤¶¨Ê±¼ä¶ÔÌØ¶¨±¨±í½øÐÐ×Ô¶¯´òÓ¡¡£±¨±íµÄÐÎʽÖ÷ÒªÊÇexcel¡£Èç¹ûÊÇc++»òÕßc#ʲôµÄ£¬¼òÖ±ÊÇС²ËÒ»µú¡£¿Éϧ£¬Æ«Æ«ÊÇjavaʵÏÖ¡£²¢ÇÒ£¬ÕâÓÖ²»Í¬ÓÚ³£¼ûµÄÒ³ÃæÊÖ¹¤´òÓ¡£¬¿ÉÒÔͨ¹ýjavascriptµ÷ÓôòÓ¡»úÀ´ÊµÏÖ¡£ÓÚÊǺõ£¬¿ªÊ¼ÃþË÷ÈçºÎʵÏָù¦ÄÜ¡£
Ê×Ï ......
public class Factory {
private static Factory factory;
private static Object classLock=Factory.class;
private Factory(){}
public static Factory getFactory(){
synchronized(classLock){
......
ÒÔÏÂÎÄ×ֲο¼×Ôhttp://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html
javadoc¹¤¾ß¿ÉÒÔ´ÓÒÔÏÂ4Àà“Ô´Îļþ”²úÉúdoc£º
(1) javaÔ´Îļþ(.java),Éú³É¶ÔÀàºÍÀàµÄ³ÉÔ±µÄdoc
(2) package×¢ÊÍÎļþ(package-info.java»òÕßpackage.html),Éú³É¶Ô°üµÄ˵Ã÷
(3) overviewÎļþ(Ãû¿ÉÒÔËæ±ã£¬Í¨³£ÊÇo ......