Java¿ì½Ý¼üÖÆ×÷
Java¿ì½Ý¼üÖÆ×÷
ÓùýVBµÄÖªµÀ°´ÏÂF5ÊÇÔËÐд°Ì壬ÓùýPhotoshopµÄÖªµÀ°´ÏÂTabÊÇÒþ²ØËùÓÐÃæ°å
£¬ÄãµÄJava³ÌÐòÒ²ÏëÓÐÕâ¸ö¹¦ÄÜô£¿ÄÇôϣÍûÕâƪÎÄÕ¶ÔÄúÓÐËù°ïÖú¡£
×Ӳ˵¥ÀàJMenuItemÓÐÒ»¸ö·½·¨²»ÖªµÀÄã×¢Òâ¹ýûÓÐ:setAccelerator¡£
´ò¿ª°ïÖúÎļþ¶ÔÕâ¸ö·½·¨µÄÃèÊöÊÇ£º ÉèÖÃ×éºÏ¼ü£¬ËüÄÜÖ±½Óµ÷Óò˵¥ÏîµÄ²Ù×÷
ÕìÌýÆ÷¶ø²»±ØÏÔʾ²Ëµ¥µÄ²ã´Î½á¹¹¡£ËùÒÔÓÃÕâ¸ö·½·¨¾ÍÄÜÖÆ×÷ÎÒÃÇËùÒªµÄ¿ì½Ý¼ü
ÁË¡£
°ïÖúÎļþ¸æËßÎÒÃÇ£¬´«¸øsetAccelerator·½·¨ËùÒªµÄÊÇÒ»¸öKeyStroke£¬ÏÂÃæÀ´
˵˵Õâ¸öÀࣺ
KeyStokeÔÚJavax.swing°üÏ£¬ËûµÄ×÷Óý«ÎÒÃÇÒªµÄ¼ü"À¦"ÆðÀ´£¬ÔÙ´«¸øÉÏÃæËù
˵µÄsetAcceleratorÖ®ÀàµÄ·½·¨À´Ê¹Óã¬KeyStokeÀàÌṩÁ˼¸¸ö"À¦"¼üµÄ¾²Ì¬ÖØ
ÔØ·½·¨£¬ÏÂÃæ˵¼¸¸öÀý×Ó£¬ÄãÃÇ×Ô¼ºÈ¥ÊÔÊÔ°É£º
F5£º KeyStroke.getKeyStroke(KeyEvent.F5, 0);
Ctrl+Q£º KeyStroke.getKeyStroke(KeyEvent.VK_Q, InputEvent.CTRL_MASK);
a£ºKeyStroke. getKeyStroke('a');
Alt+Shift+C£ºgetKeyStroke(KeyEvent.VK_C, InputEvent.ALT_MASK |
InputEvent.SHIFT_MASK, true);
µ±È»£¬Èç¹ûÄã²»ÏëÒýÈëһЩÈçKeyEvent»òInputEventÀàµÄ»°£¬ÄÇôÄã¾Í¿ÉÒÔÓÃ
KeyStroke.getKeyStroke(String s)·½·¨À´¼ò»¯Ëû£º
F5£ºKeyStroke.getKeyStroke("F5");
Ctrl+Q£ºKeyStroke.getKeyStroke("control Q ");
a£ºKeyStroke.getKeyStroke( "typed a" );
Alt+Shift+C£ºgetKeyStroke("alt shift released X ");
ÈçΪ×Ӳ˵¥"´ò¿ª"(ÃûΪ£ºmeuOpen)¼ÓÈë¿ì½Ý¼üCtrl+O£º
meuOpen.setAccelerator(KeyStroke.getKeyStroke("control O"));
ÉÏÃæ˵µÄÊÇ×Ӳ˵¥µÄ¿ì½Ý¼üÉèÖã¬ÏÖÔÚ˵ÏÂÆäËü¿Ø¼þµÄ¿ì½Ý¼üÉèÖãº
°Ñ¿ª°ïÖúÎļþ£¬½øÈë javax.swing.AbstractButton £¬Äã¿ÉÒÔÕÒµ½setMnemonic
(int mnemonic)£¬Õâ¾ÍÊÇAbstractButton×ÓÀàÉèÖÿì½Ý¼üµÄ·½·¨ÁË£¬ÈçÒ»¸ö°´Å¥
btn£¬ÉèÖÿì½Ý¼üΪ£ºbtn.setMnemonic (KeyEvent.A)£¬ÔòËüµÄ¿ì½Ý·½Ê½ÎªAlt+A
£¬ËüÓÐÒ»¸öÐÞÊη½·¨ setDisplayedMnemonicIndex (int index)£¬×÷ÓÃÊÇÉèÖñê
ÌâµÄµÚ¼¸¸ö×Ö·û¼Ó¸öÏ»®ÏßÀ´±êʶ¿ì½Ý¼ü£¬Èçbtn.setText
("Open");btn.setDisplayedMnemonicIndex(0)£¬ÔòbtnµÄ±êÌâ±äΪOpen¡£
´ÏÃ÷µÄÄãÃÇÍ»ÀàÅÔͨ°É£¬Ò»¶¨¿ÉÒԳɹ¦µÄ¡£²»¹ýҪעÒâÒÔϼ¸µã£º
1¡¢ÔÚʹÓÃKeyStrokeµÄgetKeyStroke(String s)·½·¨Ê±Ó¦¸Ã×¢ÒâÓ÷¨ÈçCtrlÓÃ
control±íʾ£¬AltÓÃaltÀ´±íʾ£¬Èç¹û¼ÓÉÏ×ÖĸÔòÒªÓôóд£¬µ«Ö»ÓÐÒ»¸ö¼üÈçaʱ
£¬Ó¦¸ÃÓÃСд£º"type a"¡£
2¡¢KeyStroke
Ïà¹ØÎĵµ£º
1.Java ¼¯ºÏ¿ò¼Üͼ
¡¡¡¡-¼¯ºÏ½Ó¿Ú£º6¸ö½Ó¿Ú£¨¶ÌÐéÏß±íʾ£©£¬±íʾ²»Í¬¼¯ºÏÀàÐÍ£¬ÊǼ¯ºÏ¿ò¼ÜµÄ»ù´¡¡£
¡¡¡¡-³éÏóÀࣺ5¸ö³éÏóÀࣨ³¤ÐéÏß±íʾ£©£¬¶Ô¼¯ºÏ½Ó¿ÚµÄ²¿·ÖʵÏÖ¡£¿ÉÀ©Õ¹Îª×Ô¶¨Ò弯ºÏÀà¡£
¡¡¡¡-ʵÏÖÀࣺ8¸öʵÏÖÀࣨʵÏß±íʾ£©£¬¶Ô½Ó¿ÚµÄ¾ßÌåʵÏÖ¡£
¡¡¡¡2.JavaÈÝÆ÷Àà½éÉÜ
¡¡¡¡¢Ù JavaÈÝÆ÷À඼¿ÉÒÔ×Ô¶¯µØµ÷Õû×Ô¼ºµÄ³ß´ ......
(±¾ÎÄתÔØ×Ô£ºhttp://hi.baidu.com/edilyxin/blog/item/27dc152aba3e10315343c19c.html)
ÎÊÌâµÄÌá³ö£º
±àÒëÔËÐÐÏÂÃæÕâ¸ö³ÌÐò»á¿´µ½Ê²Ã´£¿
public class Test{
public static  ......
À´×Ô:http://www.cnblogs.com/shiyangxt/archive/2008/07/30/1256813.html
»·¾³£ºMyEclipse
Êý¾Ý¿â£ºmysql
Ê×ÏÈн¨JavaÏîÄ¿£¬È»ºóн¨Á½¸öÀ࣬һ¸öÊý¾Ý¿âÁ¬½Ó³ØÀ࣬һ¸ö²âÊÔÀà¡£
·Ö±ðÃüÃûConnectionPool£¬ConnectionPoolTest¡£
È»ºóн¨Ò»¸öÅäÖÃÎļþ£¬ÃüÃû£ºdbpool.properties¡£
&n ......
JAVA¹Ø¼ü×ÖÏê½â
1 finalÊý¾Ý£º
1>¶ÔÓÚ»ù±¾ÀàÐÍÇ°¼ÓÒÔfinalÐÞÊΣ¬±íʾ±»ÐÞÊεıäÁ¿Îª³£Êý£¬²»¿ÉÒÔÐ޸ġ£Ò»¸ö¼ÈÊÇstaticÓÐÊÇfinalµÄ×ֶαíʾֻռ¾ÝÒ»¶Î²»ÄܸıäµÄ´æ´¢¿Õ¼ä¡£
2>finalÓÃÓÚ¶ÔÏóÓ¦ÓÃʱ£¬finalʹӦÓú㶨²»±ä¡£Ò»µ©ÒýÓñ»³õʼ»¯Ö¸ÏòÒ»¸ö¶ÔÏ󣬾ÍÎÞ·¨ÔÙ°ÑËüÖ¸ÏòÁíÒ»¸ö¶ÔÏó¡£
& ......
PO(persistant object) ³Ö¾Ã¶ÔÏó
ÔÚ o/rÓ³ÉäµÄʱºò³öÏֵĸÅÄÈç¹ûûÓÐo/rÓ³É䣬ûÓÐÕâ¸ö¸ÅÄî´æÔÚÁË¡£Í¨³£¶ÔÓ¦Êý¾ÝÄ£ÐÍ(Êý¾Ý¿â),±¾Éí»¹Óв¿·ÖÒµÎñÂß¼µÄ´¦Àí¡£¿ÉÒÔ¿´³ÉÊÇÓëÊý¾Ý¿âÖеıíÏàÓ³ÉäµÄjava¶ÔÏó¡£×î¼òµ¥µÄPO¾ÍÊǶÔÓ¦Êý¾Ý¿âÖÐij¸ö±íÖеÄÒ»Ìõ¼Ç¼£¬¶à¸ö¼Ç¼¿ÉÒÔÓÃPOµÄ¼¯ºÏ¡£POÖÐÓ¦¸Ã²»°üº¬ÈκζÔÊý¾Ý¿âµÄ²Ù×÷¡£
......