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

JavaʼþÄ£ÐÍѧϰ£¨2£©

       µ±³ÌÐòµÄij¸öÄ£¿é±»µ÷ÓõÄʱ¿Ì²»È·¶¨£¬¾ÍÀàËÆÓڵȴýij¸öʼþµÄ·¢Éú¡£Õâʱ£¬¿ÉÒÔ¶¨Òå×Ô¼ºµÄʼþ½øÐÐÏàÓ¦µÄ´¦Àí¡£±ÈÈ磬µÈ´ýÓû§µÄÒ»´ÎÊäÈëµÈ¡£JavaµÄʼþÄ£ÐÍÒÀÀµÓÚίÍУ¬Í¨¹ý»Øµ÷·½·¨½øÐÐÏàÓ¦µÄʼþ´¦Àí¡£ÔÚʼþÔ´ÖУ¬»áÓÐfireXXXEvent()¾ÍÊǼ¤»îÏàÓ¦µÄʼþ£¬ÆäÖлá±éÀúʼþÔ´µÄ¼àÌýÆ÷¶ÓÁУ¬µ÷ÓÃÏàÓ¦¼àÌýÆ÷µÄʼþ´¦ÀíµÄ»Øµ÷·½·¨¡£µ±Ä³¸öʼþ·¢Éúʱ£¬Ê¼þÔ´»áµ÷ÓÃfireXXXEvent()¡£ÊµÏÖ×Ô¼ºµÄʼþʱ£¬ÐèÒª¶¨ÒåÏàÓ¦µÄʼþÀàÐÍ¡¢Ê¼þ¼àÌýÆ÷¡¢Ê¼þÔ´¡£ÕâÀï¿ÉÒÔ°ÑʼþºÍʼþÔ´¶¨ÒåΪ½Ó¿Ú£¬·½±ãÈÕºóÀ©Õ¹¡£
      ÕâÀÎÒʵÏÖµÄʼþÊÇÒ»¸ö¶¨Ê±Æ÷ʼþ£¬µ±Ê±¼ä¹ýÁËÖ¸¶¨¼ä¸ô£¬´¥·¢Ê¼þ¡£Æäʵ£¬Ö»ÐèÒªÒ»¸öTimer¾Í¿ÉÒÔʵÏÖÕâ¸ö¹¦ÄÜ£¬µ«ÊµÔÚûÓÐÕÒµ½ºÃµÄÀý×Ó¡£Ê¼þÔ´ConcretEventSourceÓÐTimerÊôÐÔ£¬ÔÚÖ¸¶¨Ê±¼ä¼ä¸ôµ½´ïʱ£¬µ÷ÓÃfireTimeUp¼¤»îËùÓеÄʼþ¼àÌýÆ÷£¬´Ó¶øÊµÏÖÁËʼþ´¦Àí¡£
ʼþÀà
package eventmodelstudy;
/**
* ¶¨Ê±Æ÷ʼþ£¬ÊôÐÔ¿ÉÒÔ±£´æÓÐÓõÄÐÅÏ¢£¬°üÀ¨Ê¼þÔ´
* @author Administrator
*/
public class TimerEvent {
private TimerEventSource source;//ʼþÔ´
private String time;//µ±Ç°Ê±¼ä
public TimerEvent(TimerEventSource source,String time){
this.source=source;
this.time=time;
}
public Object getSource(){
return this.source;
}
public String getTime(){
return this.time;
}
}
ʼþÔ´½Ó¿Ú
package eventmodelstudy;
/**
* ¶¨Ê±Æ÷ʼþÔ´½Ó¿Ú£¬¿ÉÒÔÌí¼Ó¡¢É¾³ý¶¨Ê±Æ÷ʼþ¼àÌýÆ÷
* @author Administrator
*/
public interface TimerEventSource {
public void addTimerListener(TimerListener tl);
public void removeTimerListener(TimerListener tl);
}
¾ßÌåʼþÔ´Àà
package eventmodelstudy;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Date;
import java.util.Iterator;
import java.util.Vector;
import javax.swing.Timer;
/**
* ¶¨Ê±Æ÷ʼþÔ´¾ßÌåµÄʵÏÖÀà¡£µ±Ê±¼äµ½Ê±¼¤»î¼àÌýÆ÷£¬µ÷ÓÃËùÓмàÌýÆ÷µÄ»Øµ÷·½·¨»Øµ÷·½·¨
* @author Administrator
*/
public class ConcretEventSource implements TimerEventSource{
private Timer timer;
//¼àÌýÆ÷¶ÓÁУ¬±£´æËùÓÐ×


Ïà¹ØÎĵµ£º

RabbitÁ÷ÃÜÂëµÄJavaʵÏÖ

1. RabbitÁ÷ÃÜÂ루Rabbit Stream Cipher£©¼ò½é
      RabbitÁ÷ÃÜÂëÊÇÓÉCryptico¹«Ë¾£¨http://www.cryptico.com£©Éè¼ÆµÄ£¬ÃÜÔ¿³¤¶È128룬
×î´ó¼ÓÃÜÏûÏ¢³¤¶ÈΪ264 Bytes£¬¼´16 TB£¬ÈôÏûÏ¢³¬¹ý¸Ã³¤¶È£¬ÔòÐèÒª¸ü»»ÃÜÔ¿¶ÔʣϵÄÏûÏ¢½øÐд¦Àí¡£ËüÊÇĿǰ°²È«ÐԽϸߣ¬¼Ó/½âÃÜËٶȱȽϸßЧµÄÁ÷ÃÜÂëÖ®Ò»£ ......

Java SwingÖеÄJTreeÄ£ÐÍ

Java SwingÖеÄJTreeÄ£ÐÍ
2009-01-04 10:40
±¾ÎĽéÉÜJava SwingÖеÄJTreeÄ£ÐÍ£¬½éÉÜÈçºÎ´´½¨¡¢Ð޸ġ¢±éÀú£¬ÉèÖÃÊ÷¡£²Î¿¼Core Java2Ïà¹ØÕ½ڼ°ÆäÔ´´úÂë¡£
SwingÊ÷ʹÓÃÈËÃÇËùÊìϤµÄÎļþ¼ÐºÍÊ÷ҶͼÀ´ÏÔʾ·Ö²ãµÄÊý¾Ý¡£Ê÷Óɽڵã×é³É£¬½Úµã¿ÉÒÔÊÇÎļþ¼Ð£¬Ò²¿ÉÒÔÊÇÊ÷Ò¶¡£Îļþ¼Ð¿ÉÒÔÓÐ×ӽڵ㣬³ý¸ù½ÚµãÖ®ÍâµÄËùÓнڵ㶼ֻÓÐÒ»¸ö¸ ......

JAVA¸ù¾ÝXML½Úµã¶ÁÈ¡XMLÎļþÄÚÈÝ

XMLÎļþ book.xml
<book>
<person>
<first>Kiran</first>
<last>Pai</last>
<age>22</age>
</person>
<person>
<first>Bill</first>
<last>Gates</last>
<age>46</age>
</person>
<person>
&l ......

JAVAÀàȨÏÞ

1¡¢ClassÀàµÄ·ÃÎÊȨÏÞ£º
public£º¿ÉÒÔ¹©ËùÓеÄÀà·ÃÎÊ¡£
ĬÈÏ(°ü·ÃÎÊȨÏÞ)£ºÄ¬ÈÏ¿ÉÒÔ³ÆÎªfriendlyµ«ÊÇ£¬javaÓïÑÔÖÐÊÇûÓÐfriendlyÕâ¸öÐÞÊηûµÄ£¬ÕâÑù³ÆºôÓ¦¸ÃÊÇÀ´Ô´ÓÚc++¡£Ä¬ÈϵķÃÎÊȨÏÞÊǰü¼¶·ÃÎÊȨÏÞ¡£
      ¼´Èç¹ûдÁËÒ»¸öÀàûÓÐд·ÃÎÊȨÏÞÐÞÊηû£¬ÄÇô¾ÍÊÇĬÈϵķÃÎÊȨÏÞ£¬ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ