JAVA½Ì³Ì SwingÓû§½çÃæÉè¼ÆÈëÃÅ
7£®1 Swing¼ò½é
7.1.1 ¼ò½é
¡¡¡¡µÚÎå½²ÖÐÎÒÃÇѧϰÁËAWT£¬AWTÊÇSwingµÄ»ù´¡¡£SwingµÄ²úÉúÖ÷ÒªÔÒò¾ÍÊÇAWT²»ÄÜÂú×ãͼÐλ¯Óû§½çÃæ·¢Õ¹µÄÐèÒª¡£
AWTÉè¼ÆµÄ³õÖÔÊÇÖ§³Ö¿ª·¢Ð¡Ó¦ÓóÌÐòµÄ¼òµ¥Óû§½çÃæ¡£ÀýÈçAWTȱÉÙ¼ôÌù°å¡¢´òÓ¡Ö§³Ö¡¢¼üÅ̵¼º½µÈÌØÐÔ£¬¶øÇÒÔÀ´µÄAWTÉõÖÁ²»°üÀ¨µ¯³öʽ²Ëµ¥»ò¹ö¶¯´°¸ñµÈ»ù±¾ÔªËØ¡£
¡¡¡¡´ËÍâAWT»¹´æÔÚ×ÅÑÏÖصÄȱÏÝ£¬ÈËÃÇʹAWTÊÊÓ¦»ùÓڼ̳еġ¢¾ßÓкܴóÉìËõÐÔµÄʼþÄ£ÐÍ£¬»ùÓÚͬλÌåµÄÌåϵ½á¹¹Ò²³ÉΪÆäÖÂÃüµÄÈõµã¡£
¡¡¡¡Ëæ×Å·¢Õ¹µÄÐèÒª£¬Swing³öÏÖÁË£¬Swing×é¼þ¼¸ºõ¶¼ÊÇÇáÁ¿×é¼þ£¬ÓëÖØÁ¿×é¼þÏà±È£¬Ã»Óб¾µØµÄ¶ÔµÈ×é¼þ£¬²»ÏñÖØÁ¿×é¼þÒªÔÚËüÃÇ×Ô¼ºµÄ±¾µØ²»Í¸Ã÷´°ÌåÖлæÖÆ£¬ÇáÁ¿×é¼þÔÚËüÃǵÄÖØÁ¿×é¼þµÄ´°¿ÚÖлæÖÆ¡£
¡¡¡¡ÕâÒ»½²ÎÒÃǽ²Ò»Ï»ù±¾µÄSwing×é¼þʹÓ÷½·¨ºÍʹÓÃSwing×é¼þ´´½¨Óû§½çÃæµÄ³õ²½·½·¨¡£
¡¡¡¡SwingÊÇÓÉ100%´¿JavaʵÏֵģ¬Swing×é¼þÊÇÓÃJavaʵÏÖµÄÇáÁ¿¼¶£¨ light-weight£©×é¼þ£¬Ã»Óб¾µØ´úÂ룬²»ÒÀÀµ²Ù×÷ϵͳµÄÖ§³Ö£¬ÕâÊÇËüÓëAWT×é¼þµÄ×î´óÇø±ð¡£ÓÉÓÚAWT×é¼þͨ¹ýÓë¾ßÌåƽ̨Ïà¹ØµÄ¶ÔµÈÀࣨPeer£©ÊµÏÖ£¬Òò´ËSwing±ÈAWT×é¼þ¾ßÓиüÇ¿µÄʵÓÃÐÔ¡£SwingÔÚ²»Í¬µÄƽ̨ÉϱíÏÖÒ»Ö£¬²¢ÇÒÓÐÄÜÁ¦Ìṩ±¾µØ´°¿Úϵͳ²»Ö§³ÖµÄÆäËüÌØÐÔ¡£
¡¡¡¡Swing²ÉÓÃÁËÒ»ÖÖMVCµÄÉè¼Æ·¶Ê½£¬¼´"Ä£ÐÍ-ÊÓͼ-¿ØÖÆ"£¨Model-View-Controller£©£¬ÆäÖÐÄ£ÐÍÓÃÀ´±£´æÄÚÈÝ£¬ÊÓͼÓÃÀ´ÏÔʾÄÚÈÝ£¬¿ØÖÆÆ÷ÓÃÀ´¿ØÖÆÓû§ÊäÈë¡£
¡¡¡¡SwingÍâ¹Û¸Ð¾õ²ÉÓÿɲåÈëµÄÍâ¹Û¸Ð¾õ£¨Pluggable Look and Feel£¬PL&F£©
¡¡¡¡ÔÚAWT×é¼þÖУ¬ÓÉÓÚ¿ØÖÆ×é¼þÍâ¹ÛµÄ¶ÔµÈÀàÓë¾ßÌåƽ̨Ïà¹Ø£¬Ê¹µÃAWT×é¼þ×ÜÊÇÖ»ÓÐÓë±¾»úÏà¹ØµÄÍâ¹Û¡£SwingʹµÃ³ÌÐòÔÚÒ»¸öƽ̨ÉÏÔËÐÐʱÄܹ»Óв»Í¬µÄÍâ¹Û¡£Óû§¿ÉÒÔÑ¡Ôñ×Ô¼ºÏ°¹ßµÄÍâ¹Û¡£ÒÔÏÂÈý·ùͼÊÇÔÚͬһ¸ö²Ù×÷ϵͳϵõ½²»Í¬µÄÍâ¹Û¡£
Metal·ç¸ñ
Motif·ç¸ñ
Windows·ç¸ñ
7.1.2 SwingµÄÀà²ã´Î½á¹¹
¡¡¡¡ÔÚjavax.swing°üÖУ¬¶¨ÒåÁËÁ½ÖÖÀàÐ͵Ä×é¼þ£º¶¥²ãÈÝÆ÷£¨JFrame£¬JApplet£¬JDialogºÍJWindow£©ºÍÇáÁ¿¼¶×é¼þ¡£Swing×é¼þ¶¼ÊÇAWTµÄContainerÀàµÄÖ±½Ó×ÓÀàºÍ¼ä½Ó×ÓÀà¡£
7.1.4 MVC(Model-View-Control)Ìåϵ½á¹¹
¡¡¡¡Swingʤ¹ýAWTµÄÖ÷ÒªÓÅÊÆÔÚÓÚMVCÌåϵ½á¹¹µÄÆÕ±éʹÓá£ÔÚÒ»¸öMVCÓû§½çÃæÖУ¬´æÈý¸öͨѶ¶ÔÏó£ºÄ£ÐÍ¡¢ÊÓͼºÍ¿Ø¼þ¡£Ä£ÐÍÊÇÖ¸¶¨µÄÂß¼±íʾ·¨£¬ÊÓͼÊÇÄ£Ð͵ĿÉÊÓ»¯±íʾ·¨£¬¶ø¿Ø¼þÔòÖ¸¶¨ÁËÈçºÎ´¦ÀíÓû§ÊäÈë¡£µ±Ä£ÐÍ·¢Éú¸Ä±äʱ£¬Ëü»á֪ͨËùÓÐÒÀÀµËüµÄÊÓͼ£¬ÊÓͼʹÓÿؼþÖ¸¶¨ÆäÏàÓ¦»úÖÆ¡£
7.2.3.5 ·Ö¸ô°å£¨JSplitPa
Ïà¹ØÎĵµ£º
javaµÃµ½µ±Ç°Ê±¼ä
Java»ù´¡ 2009-06-02 21:34:18 ÔĶÁ1289 ÆÀÂÛ0 ×ֺţº´óÖÐС
//String nowTime=new SimpleDateFormat("yyyyMMddHHmm").format(new java.util.Date());
//System.out.println(nowTime);
import java.text.Sim ......
ÏÂÔصØÖ·£ºhttp://greenvm.googlecode.com/files/JTTSEngine.7z
£¨º¬Ê¾ÀýÓëÔ´Â룬Ŀǰ½öÌṩdll·â×°£©
ÖÚËùÖÜÖª£¬ËùνTTS¼´Text To SpeechµÄÓ¢ÎÄËõд£¬Ò²¾ÍÊÇ“´ÓÎı¾×ª»»µ½ÓïÒô”¡£
TTS¼¼ÊõµÄÖ÷Òª×÷ÓÃÔÚÓÚÀûÓüÆËã»úºÏ³ÉÈËÓ²¢½«ÎÄ×ÖÐÅϢת»¯ÎªÓïÒôÐÅÏ¢½øÐв¥·Å¡£¼òµ¥µã˵£¬TTS¼¼Êõ¸³ÓèÁ˼ÆËã»ú“¿ª¿Ú ......
ÔÚJava ÖÐÊý¾ÝÀàÐ͵Ä×Ô¶¯×ª»»ÀÏÊdzöÏÖһЩÎÊÌâ
byte b1 =1 , b2 = 12; //Äܹ»Í¨¹ý
byte b3 = 128 //±àÒëµÄʱºò²»ÄÜͨ¹ý
ÎÒÃÇÖªµÀJavaÖÐÊý¾ÝÀàÐÍbyte shout char ÔÚ½øÐмÆËãµÄʱºò¶¼ÊÇ» ......
³õѧJAVA£¬ºÃ²»ÈÝÒ×½â¾öÁËÕâ¸öÊý¾Ý¿âÁ¬½ÓÎÊÌ⣬Õâ¸öÖ÷ÒªÊÇÓÐÁ½¸öÎÊÌ⣬һ¸öÊÇJDBC-odbcµÄÎÊÌ⣬Èç¹ûûÓнâ¾öºÃÊý¾ÝÔ´ÅäÖ㬾ø¶ÔÊÇÓÐÈÝÒ׳öÎÊÌâµÄ£¬¼ÙÉèÄãʹÓõÄÊÇaccessµÄÊý¾Ý¿â£¬ÕâÊÇÍøÉϵÄÒ»¸öÀý×ÓµÄÓï¾ä
String dburl="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=database.mdb";
Æäʵ²¢²»ÐèÒªÄÇô³¤£¬¼Ù ......
´ó¼ÒºÃ£¡ ÎÒ½ÐСºÂ Ò²ÊǸտªÊ¼Ñ§ÓÃJAVA¿ª·¢WEBÏîÄ¿£¬Ï£Íû´ó¼Ò¸øÎÒ½¨ÒéÏ£¬ÓÐʲô·½·¨¿ÉÒÔѧºÃ£¬ÓãʣÁ£Ö£Á¿ª·¢WEBÏîÄ¿£¡~ ÏÖÔÚÎÒ»¹Ó¦¸Ãѧµãʲô Ï£Íû´ó¼Ò¶àÖ¸µãÖ¸µã~ ÎÒÏÖÔÚSSH ѧÍêÁË£¡ ´ó¼ÒÄÜÓÐʲôºÃµãµÄ½¨ÒéÂ𣿡¡¡¡ÓеĻ°ÁªÏµÏÂÎÒллÁË¡«¡¡ ......