java synchronized - Java / Java SE
Java code:
......
synchronized(user){
int loginNum = Integer.parseInt(Main_Client_Dia.jtf2.getText().trim());
Main_Client_Dia.jtf2.setText("");
loginNum++;
Main_Client_Dia.jtf2.setText(loginNum+"");
}
......
¼¸°Ù¸öÏß³Ìͬʱ·ÃÎÊÉÏÃæµÄ´úÂë
Ϊʲô ÎÞ·¨ ʵÏÖͬ²½ÄØ
Main_Client_Dia.jtf2.setTextµÄֵʱÓÐʱ»á²»ÊÇÏëÒªµÄ½á¹û£¬
ûÌåÑé¹ýÉÏ°Ù¸öÏ̷߳ÃÎÊ£¡£¡
ÎÒ¾õµÃÓ¦¸ÃÊǶÔÏóuser²»ÄÜʵÏÖ£¡£¡
Äã°ÑÀ¨ºÅºÍÀïÃæµÄuserÈ¥µôÊÔÊÔ
Ê×ÏÈÄãҪȷ¶¨Äãÿһ¸öÏß³ÌÖеÄuserÊÇͬһ¸ö¶ÔÏó.Èç¹û²»ÊÇͬһ¸ö¶ÔÏóÒ²¾ÍûÓÐÒâÒåÁË!
¶¥
ÿ¸öuser¶ÔÏóÊÇͨ¹ý¹¹Ô캯Êý´«½øÀ´µÄ£¬Ã¿¸öÏ̵߳Äuser¶ÔÏóÊDz»Í¬µÄ
¶øÇÒ£¬ int loginNum = Integer.parseInt(Main_Client_Dia.jtf2.getText().trim());
¾³£³ö´í£¬Ìáʾ˵Main_Client_Dia.jtf2.getText().trim()µÃµ½µÄֵΪ"";
Ïà¹ØÎÊ´ð£º
µ±ÖªµÀÒ»¸öÈÕÆÚ£¬ÈçºÎ°ÑÕâ¸öÈÕÆÚËùÔÚÑ®µÄÇ°ºóÁ½¸öÈÕÆÚÈ¡³ö
±ÈÈçÊäÈë20090905£¬¾ÍÊäÈë20090901 20090910
Êä³ö20090901 20090910
È¡µÃÌìÊýºó×÷Ò»ÏÂÅжÏÔÙ°ÑÕâ¸ö·½·¨ÓÃÏÂvoid set(int field, int value)
......
java swing ³ÌÐòÈçºÎ´ò°ü³Éjar£¬È»ºó¿ÉÒÔͨ¹ýÅú´¦ÀíÎļþbatÖ±½ÓÔËÐУ¬ÓÐûÓÐʲô¹¤¾ßÖ±½Ó¿ÉÒÔÍê³ÉÕâÁ½¸ö¹¤×÷£¿
ÓÃjar´ò°ü£¬°ÑÔËÐÐÐèÒªµÄjar¿½±´µ½Ò»¸öĿ¼£¬Åú´¦ÀíÓà start javaw -cp .;ÆäËû°ü·¾¶ ÔËÐÐ
ÓÃzip ......
È磺 @superwaring("unchecked");
Õâ¸öÀïÃ涼¿ÉÒÔÈ¡ÄÄЩֵ°¡£¬»¹ÓÐÀàËÆµÄ @superwaring±êÇ©ÓÐÄÄЩ°¡
ûÓùý¡£¡£
¿´jeeµÄapi
javax.persistenceÀï
@superwaring("unchecked");Ö»ÊǺöÂÔ ......
ÔھƵê¹ÜÀíϵͳÖÐ,ÓÐÒ»¸ö¶ÔÄÚµÄϵͳ,¹©Ç°Ì¨·þÎñÔ±ºÍ¾ÀíʹÓÃ
»¹ÓÐÒ»¸ö¾ÍÊǶÔÍâ,Èÿͻ§¿ÉÒÔÔÚÍøÉÏÔ¤¶©·¿¼ä,
ËüÃÇÖ®¼äÊÇÔõôͨѶµÄ.?µ±ÎÒÌá½»Ô¤¶©·¿¼äÐÅÏ¢µÄʱºò,
ÔÚ¶ÔÄÚµÄϵͳÖÐ,ÈçºÎÖªµÀÎÒÒѾÌá½»ÁËÐÅÏ¢¹ýÈ¥.Ê¹Ç ......
ÎÒдÁ˸öjspÒ³Ã棬Ȼºó¸Ä¶¯ÁËһϣ¬¸Ä¶¯µÄÄÚÈݾÍÊÇÔÚjspÒ³ÃæµÄjsº¯ÊýÀï¼ÓÁ˸öalert()Óï¾ä£¬µ«ÊÇÎÒ·ÃÎÊÕâ¸öÒ³Ãæʱ£¬ËÀ»î¶¼ÊÇÔÀ´Ò³ÃæµÄÄÚÈÝ£¬ÎÒ¼ÓÁ˺ܶàalertº¯Êý»¹ÊÇû¸Ä¶¯Ç°µÄÒ³ÃæÄÚÈÝ£»tomcatÖØÆôÁË£¬Ò²ÖØв¿ÊðÕâ ......