EclipseʹÓÃActiveX¿Ø¼þ£¨OCX£©¿ª·¢Java³ÌÐò
±¾·¶ÀýÒÔʹÓÃÀ´µçÏÔʾActiveX¿Ø¼þJDComport.ocxΪÀý£¬ËµÃ÷ÔõÑùÔÚJavaÖм¯³ÉActiveX¿Ø¼þ¡£
1¡¢¿ª·¢»·¾³£ºEclipse£¨JavaÖ÷Á÷¿ª·¢¹¤¾ß£©
£¨1£©ÐèÒªÓõ½SWT¡¢Visual Editor²å¼þ£»
£¨2£©EclipseÈí¼þ¼°ÆäÏà¹Ø²å¼þ¿Éµ½ http://www.eclipse.org/downloads/ ÏÂÔØ¡£
2¡¢ÐèÒªÓõ½JDComport.ocx
£¨1£©JDComport.ocxÊǸßÉîÉÌ¿ª·¢µÄÀ´µçÏÔʾActiveX¿Ø¼þ£¬ÏÂÔصØÖ·£ºhttp://www.kosen.com.cn/news/admin/attachments/month_0907/JDComPort.rar
£¨2£©JDComport.ocxʹÓÃÏêÇéÇë²Î¿¼£ºhttp://www.kosen.com.cn/news/showatc.asp?id=123
£¨3£©ÔÚ¿ª·¢Ö®Ç°ÇëÏÈ×¢²á£¬¿ÉÖ±½ÓÔËÐÐREGJD.bat½øÐÐ×¢²á¡£
3¡¢Javaµ÷ÓÃActiveX¿Ø¼þµÄ¹Ø¼üÊÇʹÓÃOleFrame¡¢OleControlSite¡¢OleAutomationµ÷ÓÃOCX¿Ø¼þ£¬invokeµ÷ÓÿؼþÖеĺ¯Êý£¬addEventListenerµ÷ÓÿؼþÖеÄʼþ¡£
OLEµ÷ÓõĹؼü´úÂ룺
Shell shell = new Shell();
_frame = new OleFrame(shell, SWT.NONE);
_site = new OleControlSite(_frame, SWT.NONE, "JDCompPort.JDComponent");
_auto = new OleAutomation(_site);
µ÷ÓÿؼþÖеĺ¯Êý£º
int[] ids = _auto.getIDsOfNames(new String[]{methodName});
Variant rtnv = _auto.invoke(ids[0]);
µ÷ÓÿؼþÖеÄʼþ£¨Event£©£º
_site.addEventListener(int eventID, OleListener listener);
jdc.addEventListener(jdc.idOnOpen, new OleListener(){
@Override
&
Ïà¹ØÎĵµ£º
×î½ü¶ÁÍê<Java²¢·¢±à³Ìʵ¼ù>,ÎÞÒÉÕâÊÇÒ»±¾ºÃÊé,ËüʹµÃÎÒ¶ÔÏß³Ì,Ëø,ÒÔ¼°Óë²¢·¢Ïà¹ØµÄ
һЩ֪ʶÌåϵ¸ü¼ÓÍ걸,Ïл°²»¶à˵,ÏÂÃæÎÒϵͳÊáÀíÁËÏÂÀïÃæµÄһЩÀíÂÛÒªµã,ÏàÐÅʵ¼ùÉÏ
Ãæ,´ó¼Ò»ò¶à»òÉÙ¶¼»áÓÐÌå»á,ÄÇôÓÃÀíÂÛµÄ֪ʶµã½«Êµ¼ùÌå»áÁýÂçÆðÀ´,½«»áÐγɸü¼ÓÀιÌ
ºÍÍ걸µÄ֪ʶÌåϵ,ÖÁÉÙÎÒÕâôÈÏΪ,дÕâһƪ±Ê¼ÇÒ²ÊÇÓÃÒÔ ......
ËäÈ»¿ÉÒÔͨ¹ý https://swinglabs.dev.java.net/ ·ÃÎʵ«ÊÇÒѾֹͣ¸üÐÂÁË£¬²»ÖªµÀж«¼ÒoracleÊÇ·ñ»á×ÊÖú¡£
×ÓÏîÄ¿
Ãû³Æ
ÕªÒª
actions
A simple framework for declarative actions in Swing apps
aerith
Cool JavaOne Demo
appframework
Swing Application Framework
beansbinding
Beans Bind ......
ÏîÄ¿¾ÀíµÄÖ°Ôð£º
1¡¢»ù±¾Ö°Ôð¾ÍÊÇÈ·±£ÏîÄ¿Ä¿±êµÄʵÏÖ£¬Áìµ¼ÏîÄ¿ÍŶÓ׼ʱ¡¢ÓÅÖʵØÍê³ÉÈ«²¿¹¤×÷¡£
2¡¢Óë¿Í»§¹µÍ¨£¬Á˽âÏîÄ¿µÄÕûÌåÐèÇó¡£²¢Óë¿Í»§±£³ÖÒ»¶¨µÄÁªÏµ£¬¼°Ê±·´À¡½×¶ÎÐԳɹû£¬¼°Ê±¸ü¸Ä¿Í»§Ìá³öµÄºÏÀíÐèÇó¡£
3¡¢Öƶ¨ÏîÄ¿¿ª·¢¼Æ»®Îĵµ£¬Á¿»¯ÈÎÎñ£¬²¢ºÏÀí·ÖÅä¸øÏà¹ØÈËÔ±¡£
4¡¢¸ú×ÙÏîÄ¿½ø¶È£¬Ðµ÷ÏîÄ¿×é³ÉÔ±Ö®¼äµÄºÏ ......
1.Èç¹ûÔÚÏÂÃæµÄ´úÂëÖУ¬tryLock¸Ä³Élock£¬ÄÇô»áÒ»Ö±µÈ´ý£¬Ö±µ½Äܹ»ËøÉÏÎļþΪֹ£¬µ«tryLock»áÁ¢¼´·µ»Ø¡£
Èç¹ûÒ»¸öµ÷ÓÃÁËtryLock£¬»òlock²¢Çҳɹ¦ËøÉÏÖ¸¶¨ÎļþºóµÄ³ÌÐò£¬ÔÚûÓÐÊÍ·ÅÎļþËøµÄÇé¿öÏ£¨Ã»Óе÷ÓÃrelease£©³ÌÐò¾Í½áÊø£¨°üº¬Ç¿ÖƽáÊøµÄÇé¿ö£©£¬ÄÇôÎļþËø»á×Ô¶¯±»ÊÍ·Å¡£
2.´úÂëÖеÄsleepÊÇΪÁ˱ãÓÚÑéÖ¤³ÌÐòÓõġ ......
1. ÔÚJ2SE5.0ÖÐÒª¶¨Òåö¾ÙÀàÐÍÊÇʹÓÃenum¹Ø¼ü´Ê£¬Ã¶¾ÙÀàÐÍÖ÷ÒªÌṩһЩ³£Êý¡£ÈçÏÂÁдúÂ붨ÒåÁËActionö¾ÙÀàÐÍ£º
1. ÔÚJ2SE5.0ÖÐÒª¶¨Òåö¾ÙÀàÐÍÊÇʹÓÃenum¹Ø¼ü´Ê£¬Ã¶¾ÙÀàÐÍÖ÷ÒªÌṩһЩ³£Êý¡£ÈçÏÂÁдúÂ붨ÒåÁËActionö¾ÙÀàÐÍ£º
Java´úÂë
public enum Action
{
TURN_LEFT,
TURN_RIGHT,
......