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
&
Ïà¹ØÎĵµ£º
1£¬Ê²Ã´ÊÇClone £¿
¼òµ¥µØ˵£¬ Clone ¾ÍÊǶÔÓÚ¸ø¶¨µÄÒ»¸ö¶ÔÏóʵÀý o £¬µÃµ½ÁíÒ»¸ö¶ÔÏóʵÀý o’ £º o Óë o’ Àà
ÐÍÏàͬ£¨ o.getClass() == o’.getClass() £©£¬ÄÚÈÝÏàͬ£¨¶ÔÓÚ o/o’ ÖеÄ×ֶΠf £¬Èç¹û f ÊÇ»ù±¾Êý¾ÝÀàÐÍ£¬Ôò o.f == o’.f £»Èç¹û f ÊǶÔÏóÒýÓã¬Ôò o.f == o’.f »ò o.f Ö ......
ÔÎÄ:http://www.matrix.org.cn/resource/article/44/44055_Java+Annotation+Reflect.html
¹Ø
¼ü×Ö:java,annotation,reflect
Ç°ÑÔ£º
ÔÚ
ÉÏƪÎÄÕ¡¶Java AnnotationÈëÃÅ¡·
ÖиÅÒªÐԵĽéÉÜÁËAnnotationµÄ¶¨Ò塢ʹÓ㬷¶Î§º¸Ç½Ï¹ã£¬µ«ÊÇ
Éî¶È²»¹»¡£ËùÒÔ×÷ÕßÔÚ¡¶Java AnnotationÈëÃÅ¡·ºó£¬¼ÌÐøÕûÀíÁËAnnotationµÄ¸ÅÄîºÍ ......
Ŀ¼
ÕªÒª ……………………………………………………………………2
ÎÄÏ××ÛÊö ……………………&hel ......
MySQL£º
String Driver="com.mysql.jdbc.Driver"; //Çý¶¯³ÌÐò
String URL="jdbc:mysql://localhost:3306/db_name"; //Á¬½ÓµÄURL,db_nameΪÊý¾Ý¿âÃû
String Username="username"; //̞
String Password="password"; //ÃÜÂë
Class.forName(Driver).new Instance();
......
ÏîÄ¿¾ÀíµÄÖ°Ôð£º
1¡¢»ù±¾Ö°Ôð¾ÍÊÇÈ·±£ÏîÄ¿Ä¿±êµÄʵÏÖ£¬Áìµ¼ÏîÄ¿ÍŶÓ׼ʱ¡¢ÓÅÖʵØÍê³ÉÈ«²¿¹¤×÷¡£
2¡¢Óë¿Í»§¹µÍ¨£¬Á˽âÏîÄ¿µÄÕûÌåÐèÇó¡£²¢Óë¿Í»§±£³ÖÒ»¶¨µÄÁªÏµ£¬¼°Ê±·´À¡½×¶ÎÐԳɹû£¬¼°Ê±¸ü¸Ä¿Í»§Ìá³öµÄºÏÀíÐèÇó¡£
3¡¢Öƶ¨ÏîÄ¿¿ª·¢¼Æ»®Îĵµ£¬Á¿»¯ÈÎÎñ£¬²¢ºÏÀí·ÖÅä¸øÏà¹ØÈËÔ±¡£
4¡¢¸ú×ÙÏîÄ¿½ø¶È£¬Ðµ÷ÏîÄ¿×é³ÉÔ±Ö®¼äµÄºÏ ......