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

java ʼþ»úÖÆ̽ÌÖ

javaÖеÄʼþ»úÖƵIJÎÓëÕßÓÐ3ÖÖ½ÇÉ«£º
1.event object£º¾ÍÊÇʼþ²úÉúʱ¾ßÌåµÄ“ʼþ”£¬ÓÃÓÚlistenerµÄÏàÓ¦µÄ·½·¨Ö®ÖУ¬×÷Ϊ²ÎÊý£¬Ò»°ã´æÔÚÓëlisternerµÄ·½·¨Ö®ÖÐ
2.event source£º¾ßÌåµÄ½ÓÊÜʼþµÄʵÌ壬±ÈÈç˵£¬Äãµã»÷Ò»¸öbutton£¬ÄÇôbutton¾ÍÊÇevent source£¬ÕâÑùÄã±ØÐëʹbutton¶ÔijЩʼþ½øÐÐÏàÓ¦£¬Äã¾ÍÐèҪע²áÌض¨µÄlistener£¬±ÈÈç˵MouseEventÖ®ÖÐµÄ MouseClicked·½·¨£¬ÕâÊÇËû¾Í±ØÐëÓÐÁËadd·½·¨
3.event listener£º¾ßÌåµÄ¶Ô¼àÌýµÄʼþÀ࣬µ±ÓÐÆä¶ÔÓ¦µÄevent object²úÉúµÄʱºò£¬Ëü¾Íµ÷ÓÃÏàÓ¦µÄ·½·¨£¬½øÐд¦Àí¡£ÔÚwindows³ÌÐòÉè¼ÆÀï±ßÕâÖÖÏàӦʹÓÃcallback»úÖÆÀ´ÊµÏÖµÄ
ÏÈ¿´¿´jdkÌṩµÄevent°ü£º
public interface EventListener£ºËùÓÐʼþÕìÌýÆ÷½Ó¿Ú±ØÐëÀ©Õ¹µÄ±ê¼Ç½Ó¿Ú¡£
public class EventObject extends Object implements Serializable
ËùÓÐʼþ״̬¶ÔÏ󶼽«´ÓÆäÅÉÉúµÄ¸ùÀà¡£ ËùÓÐ Event ÔÚ¹¹Ôìʱ¶¼ÒýÓÃÁ˶ÔÏó "source"£¬ÔÚÂß¼­ÉÏÈÏΪ¸Ã¶ÔÏóÊÇ×î³õ·¢ÉúÓÐ¹Ø Event µÄ¶ÔÏó¡£
        ÔÚJava2´¦Àíʼþʱ£¬Ã»ÓвÉÓÃdispatchEvent()-postEvent()-handleEvent()·½Ê½£¬²ÉÓÃÁ˼àÌýÆ÷À࣬ÿ¸öʼþÀ඼ÓÐÏà¹ØÁªµÄ¼àÌýÆ÷½Ó¿Ú¡£Ê¼þ´ÓʼþÔ´µ½¼àÌýÕߵĴ«µÝÊÇͨ¹ý¶ÔÄ¿±ê¼àÌýÕ߶ÔÏóµÄJava·½·¨µ÷ÓýøÐеġ£ 
¡¡¡¡¶Ôÿ¸öÃ÷È·µÄʼþµÄ·¢Éú£¬¶¼ÏàÓ¦µØ¶¨ÒåÒ»¸öÃ÷È·µÄJava·½·¨¡£ÕâЩ·½·¨¶¼¼¯Öж¨ÒåÔÚʼþ¼àÌýÕߣ¨EventListener£©½Ó¿ÚÖУ¬Õâ¸ö½Ó¿ÚÒª¼Ì³Ð java.util.EventListener¡£ ʵÏÖÁËʼþ¼àÌýÕß½Ó¿ÚÖÐһЩ»òÈ«²¿·½·¨µÄÀà¾ÍÊÇʼþ¼àÌýÕß¡£ 
¡¡¡¡°éËæ×ÅʼþµÄ·¢Éú£¬ÏàÓ¦µÄ״̬ͨ³£¶¼·â×°ÔÚʼþ״̬¶ÔÏóÖУ¬¸Ã¶ÔÏó±ØÐë¼Ì³Ð×Ôjava.util.EventObject¡£Ê¼þ״̬¶ÔÏó×÷Ϊµ¥²Î´«µÝ¸øÓ¦ÏìÓ¦¸ÃʼþµÄ¼àÌýÕß·½·¨ÖС£·¢³öijÖÖÌض¨Ê¼þµÄʼþÔ´µÄ±êʶÊÇ£º×ñ´Ó¹æ¶¨µÄÉè¼Æ¸ñʽΪʼþ¼àÌýÕ߶¨Òå×¢²á·½·¨£¬²¢½ÓÊܶÔÖ¸¶¨Ê¼þ¼àÌýÕß½Ó¿ÚʵÀýµÄÒýÓᣠ
¿ªÊ¼Ö®Ç°Ê×ÏÈÎʸöÎÊÌ⣺ÄúÊìϤjava.util.EventObject ºÍjava.util.EventListenerÁ½¸öÀàÒÔ¼°ËûÃÇÒÑÓеÄ×ÓÀàÂð£¿
Èç¹ûÄãÒѾ­Äܹ»ÊìÁ·Ê¹ÓÃjdkΪÎÒÃÇÌṩµÄʼþ¼àÌýÆ÷£¬²¢ÇÒºÜÊìϤMouseEvent, KeyEvent, WindowEventµÈµÈÕâЩjdkΪÎÒÃÇ×¼±¸ºÃµÄʼþ£¬ÄÇôÏë±ØÄã¶ÔjavaµÄʼþ»úÖÆÒѾ­ÓÐËùÀí½â¡£µ«ÊÇÒ²ÐíÄ㻹ÊǾõµÃËäÈ»ÓÃÆðÀ´Ã»Ê²Ã´ÎÊÌ⣬µ«ÊÇÔ­Àí»¹ÊÇÓÐЩºýÍ¿£¬ÄÇôÏÂÃæÎÒÃÇÔÙ½øÒ»²½×Ô¼ºÊµÏÖÕâЩʼþºÍ¼àÌýÆ÷£¬ÎÒÃÇ°ÑÕâ¸öÈ¡ÃûΪ×Ô¶¨Òåʼþ¡£
Æäʵ×Ô¶¨ÒåÊÂ


Ïà¹ØÎĵµ£º

javaÈëÃÅ

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

java ÕÒ³ö100ÒÔÄÚµÄËØÊý

 public class FindPrime {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int num = 100;
String s = "100ÒÔÄÚµÄËØÊý£º";
for (int i = 1; i <= num; i++) {
int count = 0;
for (int j = 1; j <= (int) Math.s ......

java ÕÒ³ö4λÊýµÄËùÓÐÎüѪ¹íÊý×Ö

 /**
* ÕÒ³öËÄλÊýËùÓеÄÎüѪ¹íÊý×Ö
* ÎüѪ¹íÊý×Ö£ºÎ»ÊýΪżÊýµÄÊý×Ö¿ÉÒÔÓÉÒ»¶ÔÊý×ÖÏà³Ë¶øµÃ£¬Õâ¶ÔÊý×Ö°üº¬³Ë»ýÒ»°ëµÄλÊý
* È磺1260 = 21*60
*/
public class Vampire {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub

String s= ......

ʹÓÃJNI¼¼ÊõʵÏÖJAVA³ÌÐòµ÷ÓÃdll

 JAVAµÄ¿çƽ̨µÄÌØÐÔÉîÊÜjava³ÌÐòÔ±ÃǵÄϲ°®,µ«ÕýÊÇÓÉÓÚËüΪÁËʵÏÖ¿çƽ̨µÄÄ¿µÄ,ʹµÃËüºÍ±¾µØ»úÆ÷µÄ¸÷ÖÖÄÚ²¿ÁªÏµ±äµÃºÜÉÙ,´ó´óÔ¼ÊøÁËËüµÄ¹¦ÄÜ,±ÈÈçÓëһЩӲ¼þÉ豸ͨÐÅ,ÍùÍùÒª»¨·ÑºÜ´óµÄ¾«Á¦È¥Éè¼ÆÁ÷³Ì±àд´úÂëÈ¥¹ÜÀíÉ豸¶Ë¿Ú,¶øÇÒÓÐһЩÉ豸³§ÉÌÌṩµÄÓ²¼þ½Ó¿ÚÒѾ­¾­¹ýÒ»¶¨µÄ·â×°ºÍ´¦Àí,²»ÄÜÖ±½ÓʹÓÃjava³ÌÐòͨ¹ý¶Ë¿Úº ......

JAVA JNI ʹÓÃʵÀý

 JAVA¿ÉÒÔͨ¹ýJNI½Ó¿Ú·ÃÎʱ¾µØµÄ¶¯Ì¬Á¬½Ó¿â£¬´Ó¶øÀ©Õ¹JAVAµÄ¹¦ÄÜ¡£Ê¹ÓÃJAVA JNI½Ó¿ÚÖ÷Òª°üÀ¨ÒÔϲ½Ö裺
(1)±àдJAVA´úÂ룬עÃ÷Òª·ÃÎʵı¾µØ¶¯Ì¬Á¬½Ó¿âºÍ±¾µØ·½·¨£»
(2)±àÒëJAVA´úÂëµÃµ½.classÎļþ£»
(3)ʹÓÃjavah -jni Éú³É¸ÃÀà¶ÔÓ¦µÄCÓïÑÔ.hÎļþ£»
(4)ʹÓÃC/C++ʵÏÖ£¨3£©Éú³ÉµÄ.hÎļþÖÐÉùÃ÷µÄ¸÷º¯Êý£»
(5)±àÒëC/ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ