Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

XULRunner with Java: JavaXPCOM Tutorial 3

6 ¼ÓÔØÒ³ÃæµÄW3C DOM·ÃÎÊ
6.1 mozdom4java¿â
  ·ÃÎÊW3C DOMÊ÷±È·ÃÎÊMozillaµÄDOMÊ÷ÒªºÃ£¬ÒòΪËüÊÇÒ»¸ö¶¯Ì¬·ÃÎÊHTMLºÍXMLµÄDOMÊ÷µÄ±ê×¼¡£ÎªÁËʵÏÖÕâ¸ö£¬ÎÒÃÇʹÓôÓMozilla
DOMµ½W3C DOMµÄjava Bridge¡£ÓÐÒ»¸ö½Ð×ömozdom4javaµÄÏîÄ¿http://mozdom4java.mozdev.org/index.html¡£
  ÏÂÔØÕâ¸ö°üºó£¬ÎÒÃǰÑjar°ü·Åµ½classpathÀï¡£ÀýÈ磬ÎÒÃÇÔö¼ÓÒ»¸ö°´Å¥À´³éÈ¡HTMLÎĵµÀïµÄËùÓÐÁ´½Ó¡£
// When that button is pressed, then we obtain the HTML document corresponding to
// the URL loaded in browser. Next, we extract all its child nodes with 'a' tag name
// and print its content.
final ToolItem anchorItem = new ToolItem(toolbar, SWT.PUSH);
anchorItem.setImage(getImage("resources/anchors.png"));
anchorItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {

// First, we obtain a Mozilla DOM Document representation
nsIDOMDocument doc = browser.getDocument();

// Get all anchors from the loaded HTML document
nsIDOMNodeList nodeList = doc.getElementsByTagName("a");
for ( int i = 0; i < nodeList.getLength(); i++ ){

// Get Mozilla DOM node
nsIDOMNode mozNode = nodeList.item(i);

// Get the appropiate interface
nsIDOMHTMLAnchorElement mozAnchor =
(nsIDOMHTMLAnchorElement) mozNode.queryInterface(
nsIDOMHTMLAnchorElement.NS_IDOMHTMLANCHORELEMENT_IID);

// Get the corresponding W3C DOM node
HTMLAnchorElement a = (HTMLAnchorElement)
HTMLAnchorElementImpl.getDOMInstance(mozAnchor);


Ïà¹ØÎĵµ£º

JAVA±íµ¥×Ô¶¨ÒåµÄÉèÏëÓëºÃ´¦

˵µ½OAϵͳ¾Í»áÏëµ½·¢²¼¹«¸æ¡¢ÉóÅúÎļþ¡¢Îļþ¹ÜÀíµÈµÈÕâЩ¹¦ÄÜ£¬£¬µ½ÁË¿ª·¢ÈËÔ±ÊÖÀï¾ÍÊÇ´æ´¢Êý¾Ý¡¢²éѯÊý¾Ý£¬ÍùÍù²»Í£µÄ×öÖØ¸´¹¤×÷£¬ÓÚÊǾÍÓÐÁËOA±íµ¥ÒýÇæµÄÉèÏëºÍ¹¹Ë¼¡£ÓÃjavascript¶¨Òå±íµ¥£¬ÓÃjavaÇý¶¯XML£¬×Ô¶¯´´½¨¡¢ÐÞ¸ÄÊý¾Ý¿â¡£ÊµÏÖ¶Ô±íµ¥µÄͼÐλ¯ÖÆ×÷£¬¼´Ê¹ÊǷǼ¼ÊõÈËÔ±Ò²¿ÉËæÒâÉè¼Æ³ö×Ô¼º¹¹ÏëµÄ±íµ¥¹¦ÄÜ¡£
JAVA³ÌÐ ......

JAVAµÄÈÝÆ÷ List,Map,Set

JAVAÈÝÆ÷
¡¡¡¡½âÊÍÒ»£º
¡¡¡¡ÈÝÆ÷£¨Container£©
¡¡¡¡Spring ÌṩÈÝÆ÷¹¦ÄÜ£¬ÈÝÆ÷¿ÉÒÔ¹ÜÀí¶ÔÏóµÄÉúÃüÖÜÆÚ¡¢¶ÔÏóÓë¶ÔÏóÖ®¼äµÄÒÀÀµ¹ØÏµ£¬Äú¿ÉÒÔʹÓÃÒ»¸öÅäÖÃÎļþ£¨Í¨³£ÊÇXML£©£¬ÔÚÉÏÃæ¶¨ÒåºÃ¶ÔÏóµÄÃû³Æ¡¢ÈçºÎ²úÉú£¨Prototype ·½Ê½»òSingleton ·½Ê½£©¡¢Äĸö¶ÔÏó²úÉúÖ®ºó±ØÐëÉ趨³ÉΪij¸ö¶ÔÏóµÄÊôÐԵȣ¬ÔÚÆô¶¯ÈÝÆ÷Ö®ºó£¬ËùÓÐ ......

Object Ordering java ÅÅÐò

Object Ordering
A List l may be sorted as follows.
Collections.sort(l);
If the List consists of String elements, it will be sorted into alphabetical order. If it consists of Date elements, it will be sorted into chronological order. How does this happen? String and Date both implement the Compara ......

XULRunner with Java: JavaXPCOM Tutorial 2

4 ÔÚjava´úÂëÀïǶÈëFirefox3
  ÏÖÔÚ¿ÉÒÔÈ¥ÓÃÒ»ÏÂÓÐÓõÄÀý×ÓÁË¡£Ê×ÏÈÎÒÃÇÔÚÒ»¸öjava³ÌÐòÀïʹÓÃSWTÀ´Ç¶ÈëÒ»¸öMozillaä¯ÀÀÆ÷¡£ÏÖÔÚ£¬ÎÒÃÇ¿ÉÒÔʹÓÃ
org.eclipse.swt.browser.BrowserÀàÀ´ÊµÀý»¯£ºbrowser = new Browser(shell, SWT.MOZILLA); ÔÚÕâ֮ǰ£¬ÎÒÃÇÐèҪʹÓÃATFÏîÄ¿
£¬ÒÔ¼°Ò»ÏÂATF²å¼þ¡£·Ç³£ÐÒÔË£¬ÏÖÔÚÎÒÃDz»ÐèÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ