JavaÖеÄ×Ö·û¼¯±àÂëÈëÃÅ 2
¡¡¡¡Ëµµ½GB2312ºÍGBK¾Í²»µÃ²»ÌáÖÐÎÄÍøÒ³µÄ±àÂë¡£¾¡¹ÜºÜ¶àпª·¢µÄWebϵͳºÍÐÂÉÏÏßµÄ×¢Öعú¼Ê»¯µÄÍøÕ¾¶¼¿ªÊ¼Ê¹ÓÃUTF-8£¬ÈÔÓÐÏ൱һ²¿·ÖµÄÖÐÎÄýÌå¼á³ÖʹÓÃGB2312ºÍGBK£¬ÀýÈçÐÂÀ˵ÄÒ³Ãæ¡£ÆäÖÐÓÐÁ½µãºÜÖµµÃ×¢Òâ¡£
¡¡¡¡µÚÒ»£¬Ò³ÃæÖÐmeta±êÇ©µÄ²¿·Ö£¬³£³£¿ÉÒÔ¼ûµ½charset=GB2312ÕâÑùµÄд·¨£¬ºÜ²»ÐÒµÄÊÇ£¬Õâ¸ö“charset”ÆäʵÊÇÓÃÀ´Ö¸¶¨Ò³ ÃæʹÓõÄÊÇʲô×Ö·û¼¯±àÂ룬¶ø²»ÊÇʹÓÃʲô×Ö·û¼¯¡£ÀýÈçÄã¼ûµ½¹ýÓÐÈËд“charset=UTF-8”£¬¼ûµ½¹ýÓÐÈËд“charset=ISO- 8859-1”£¬µ«Äã¼û¹ýÓÐÈËд“charset=Unicode”ô?µ±È»Ã»ÓУ¬ÒòΪUnicodeÊÇÒ»¸ö×Ö·û¼¯£¬¶ø²»ÊDZàÂë¡£
¡¡¡¡È»¶øÕýÊÇcharsetÕâ¸öÃû³ÆÎóµ¼Á˺ܶà³ÌÐòÔ±£¬ÕæµÄÒÔΪÕâÀïÒªÖ¸¶¨µÄÊÇ×Ö·û¼¯£¬Ò²Òò¶øʹËûÃǽøÒ»²½µÄÎóÒÔΪUTF-8ºÍUTF-16ÊÇÒ»ÖÖ ×Ö·û¼¯!(Íò¶ñ°¡)ºÃÔÚXMLÖÐÒѾ×ö³öÁËÐ޸ģ¬Õâ¸öλÖøijÉÁËÕýÈ·µÄÃû³Æ£ºencoding.µÚ¶þ£¬Ò³ÃæÖÐ˵µÄGB2312£¬Êµ¼ÊÉϲ¢²»ÕæµÄÊÇ GB2312(¾ªÑÈô?)¡£ÎÒÃÇÀ´×ö¸öʵÑ飬ÀýÈçÕÒÒ»¸öGB2312Öв»´æÔڵĺº×Ö“亸”(Õâ¸ö×Öȷʵ²»ÔÚGB2312ÖУ¬Äã¿ÉÒÔµ½GB2312µÄÂë±íÖРȥÕÒ£¬±£Ö¤ÕÒ²»µ½)£¬Õâ¸ö×ÖÔÚGBKÖС£È»ºóÄã°ÑËü·Åµ½Ò»¸öhtmlÒ³ÃæÖУ¬ÊÔ×ÅÔÚä¯ÀÀÆ÷Öдò¿ªËü£¬È»ºóÑ¡Ôñä¯ÀÀÆ÷µÄ±àÂëΪ“GB2312”£¬¿´µ½ÁËʲ ô?ËüÍêÈ«Õý³£ÏÔʾ!
¡¡¡¡½áÂÛ²»ÓÃÎÒ˵ÄãÒ²Ã÷°×ÁË£¬ä¯ÀÀÆ÷ʵ¼ÊÉÏʹÓõÄÊÇGBKÀ´ÏÔʾ¡£
¡¡¡¡ÐÂÀ˵ÄÒ³ÃæÖÐÒ²ÓкܶàÕâÑùµÄÀý×Ó£¬µ½´¦¶¼Ð´charset=GB2312£¬È´Ê¹ÓÃÁËÎÞÊý¸öGB2312Öв¢²»´æÔÚµÄ×Ö·û¡£ÕâÖÖ×ö·¨¶Ôä¯ÀÀÆ÷ÏÔʾ Ò³Ãæ²¢²»³ÉÎÊÌ⣬µ«ÔÚÐèÒª³ÌÐòץȡҳÃæ²¢±£´æµÄʱºò´øÀ´ÁËÂé·³£¬³ÌÐò½«²»ÄÜÒÀ¾ÝÒ³ÃæËù“Éù³Æ”µÄ±àÂë½øÐжÁÈ¡ºÍ±£´æ£¬¶øÖ»Äܾ¡Á¿²Â²âÕýÈ·µÄ±àÂë¡£
Ò»¸öÍøÒ³ÒªÏëÔÚä¯ÀÀÆ÷ÖÐÄܹ»ÕýÈ·ÏÔʾ£¬ÐèÒªÔÚÈý¸öµØ·½±£³Ö±àÂëµÄÒ»Ö£ºÍøÒ³Îļþ£¬ÍøÒ³±àÂëÉùÃ÷ºÍä¯ÀÀÆ÷±àÂëÉèÖá£
¡¡¡¡Ê×ÏÈÊÇÍøÒ³Îļþ±¾ÉíµÄ±àÂ룬¼´ÍøÒ³ÎļþÔÚ±»´´½¨µÄʱºòʹÓÃʲô±àÂëÀ´±£´æ¡£Õâ¸öÍêÈ«È¡¾öÓÚ´´½¨¸ÃÍøÒ³µÄÈËԱʹÓÃÁËʲô±àÂë±£´æ£¬¶ø½øÒ»²½µÄÈ¡¾ö ÓÚ¸ÃÈËԱʹÓõIJÙ×÷ϵͳ¡£ÀýÈçÎÒÃÇʹÓõÄÖÐÎÄ°æWindowsXPϵͳ£¬µ±Äãн¨Ò»¸öÎı¾Îļþ£¬Ð´ÈëһЩÄÚÈÝ£¬²¢°´ÏÂctrl+s½øÐб£´æµÄÄÇÒ»¿Ì£¬²Ù×÷ ϵͳ¾ÍÌæÄãʹÓÃGBK±àÂ뽫Îļþ½øÐÐÁ˱£´æ(ûÓÐʹÓÃUTF-8£¬Ò²Ã»ÓÐʹÓÃUTF-16)¡£¶øʹÓÃÁËÓ¢ÎÄϵͳµÄÈË£¬ÏµÍ³»áʹÓÃISO-8859-1½øÐÐ ±£´æ£¬ÕâÒ²Òâζ×Å£¬ÔÚÓ¢ÎÄϵͳµÄÎļþÖÐÈç¹ûÊäÈëÒ»¸öºº×Ö£¬ÊÇÎÞ·¨½øÐб£´æµÄ(µ±È»£¬ÄãÉõÖ
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
package server;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Recta ......
ÎÒÔÚÍæÒ»¸öÍøÒ³ÓÎÏ·µÄʱºò×ÜÊÇ°´Ò»¸ö¼ü¡£¾õ×ÅÀÛ¡£ËùÒÔ¾ÍдÁËÒ»¸ö³ÌÐò¡£
Robot r = new Robot();
// °´¼ü
r.keyPress(51);
// ÊÍ·Å
r.keyRelease(51);
ÓÃRobot Õâ¸öʵÏÖ×Ô¶¯»¯µÄÀà¾Í¿É×öµ½¡£ÊµÏÖÕâ¸öÓÎÏ·Ò»Ö±°´ÏÂÕâ¸ö¼ü×Ó¡£
Ò²¿ÉÒÔ×ö°´¼ü¾«ÁéÀàËƵÄÈí¼þ¡£µ«ÊÇÕâ¸öÀàÖ»ÄÜÓ¦Óõ±Ç°´°¿Ú¡£ÔõôÄÜ°ÑÕâ¸ö³ÌÐò¹Ì¶¨ÔÚij ......
1. Java Ô´ÎļþÖÐ×î¶àÖ»ÄÜÓÐÒ»¸öpublicÀà,¶øÇÒÕâ¸öÀàµÄÀàÃûÒªºÍÎļþÃûÒ»ÖÂ.ÆäËûÀàµÄ¸öÊý²»ÏÞ¡£
2. ÃæÏò¶ÔÏó³ÌÐòÉè¼ÆµÄÌØÕ÷£¨·â×°ÐÔ£©£¨¼Ì³Ð£©£¨¶à̬ÐÔ£©
3. ½Ó¿ÚÊÇÓÉ£¨³éÏó·½·¨£©ºÍ£¨³£Á¿£©×é³ÉµÄÌØÊâÀà
4. ÓÃstaticÐÞÊεķ½·¨Ê ......