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µÄʼþ»úÖÆÒѾÓÐËùÀí½â¡£µ«ÊÇÒ²ÐíÄ㻹ÊǾõµÃËäÈ»ÓÃÆðÀ´Ã»Ê²Ã´ÎÊÌ⣬µ«ÊÇÔÀí»¹ÊÇÓÐЩºýÍ¿£¬ÄÇôÏÂÃæÎÒÃÇÔÙ½øÒ»²½×Ô¼ºÊµÏÖÕâЩʼþºÍ¼àÌýÆ÷£¬ÎÒÃÇ°ÑÕâ¸öÈ¡ÃûΪ×Ô¶¨Òåʼþ¡£
Æäʵ×Ô¶¨ÒåÊÂ
Ïà¹ØÎĵµ£º
1. ÒýÑÔ
¡¡¡¡½üÄêÀ´£¬Ëæ×ÅInternet/Intranet½¨Íø¼¼ÊõµÄ·ÉËÙ·¢Õ¹ºÍÔÚÊÀ½ç·¶Î§ÄÚµÄѸËÙÆÕ¼°£¬¼ÆËã»ú
¡¡¡¡Ó¦ÓóÌÐòÒÑ´Ó´«Í³µÄ×ÀÃæÓ¦ÓÃתµ½WebÓ¦Ó᣻ùÓÚB/S£¨Browser/Server£©¼Ü¹¹µÄ3²ã¿ª·¢Ä£Ê½Öð½¥È¡´úC/S£¨Client/Server£©¼Ü¹¹µÄ¿ª·¢Ä£Ê½£¬³ÉΪ¿ª·¢ÆóÒµ¼¶Ó¦Óú͵ç×ÓÉÌÎñÆÕ±é²ÉÓõļ¼Êõ¡£ÔÚWebÓ¦Óÿª·¢µÄÔçÆÚ£¬Ö÷ҪʹÓõ ......
Java
鍼뱎˜
MC
ËùÓÐ
ITEM
1
¡¢
mc
±éÀú
item
ÔÀí
Mc
±éÀú
item
Óõ½µÄÃüÁîÓÐÈý¸ö£º
stats items
£¬
stats cachedump, get
¡£Í¨¹ý
telnet
³ÌÐò
telnet
µ½
mc
·þÎñÆ÷ÉÏ£¨
telnet ip
µØÖ·
¶Ë¿ÚºÅ£¬Èç
telnet 192.168.0.1 11211
£©£¬ÒÀ´ÎÖ ......
import java.util.*;
public class ForeachExample {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Random r = new Random();
int[] x = new int[10];
for (int i = 0; i < x.length; i++) {
x[i] = r.nextInt(100);
}
/ ......
JAVAµÄ¿çƽ̨µÄÌØÐÔÉîÊÜjava³ÌÐòÔ±ÃǵÄϲ°®,µ«ÕýÊÇÓÉÓÚËüΪÁËʵÏÖ¿çƽ̨µÄÄ¿µÄ,ʹµÃËüºÍ±¾µØ»úÆ÷µÄ¸÷ÖÖÄÚ²¿ÁªÏµ±äµÃºÜÉÙ,´ó´óÔ¼ÊøÁËËüµÄ¹¦ÄÜ,±ÈÈçÓëһЩӲ¼þÉ豸ͨÐÅ,ÍùÍùÒª»¨·ÑºÜ´óµÄ¾«Á¦È¥Éè¼ÆÁ÷³Ì±àд´úÂëÈ¥¹ÜÀíÉ豸¶Ë¿Ú,¶øÇÒÓÐһЩÉ豸³§ÉÌÌṩµÄÓ²¼þ½Ó¿ÚÒѾ¾¹ýÒ»¶¨µÄ·â×°ºÍ´¦Àí,²»ÄÜÖ±½ÓʹÓÃjava³ÌÐòͨ¹ý¶Ë¿Úº ......
±¾ÆªÖ¼ÔÚ°ïÖú×¼±¸Ñ§Ï°JavaÒÔ¼°¸Õ½Ó´¥JavaµÄÅóÓÑÈÏʶ¡¢ÕÆÎÕºÍʹÓÃstatic¡¢this¡¢super¡¢finalÕ⼸¸ö¹Ø¼ü×ÖµÄʹÓá£Java²©´ó¾«ÉÎÒÒ²ÊÇһλÕýÔÚѧϰºÍʹÓÃJavaµÄ°®ºÃÕߣ¬ÎÄÖÐÄÑÃâÓв»Í×Ö®´¦£¬»¶ÓÖ¸Õý¡£
Ò»¡¢static
¡¡ÇëÏÈ¿´ÏÂÃæÕâ¶Î³ÌÐò£º
public class Hello{
public static void main(String[] args){ ......