javaÖеÄSynthÍâ¹Û
javaÖеÄSynthÍâ¹Û
Synth£¬ËüÊÇÒ»¸öÍêÕûµÄÍâ¹Û£¬¶ø²»ÊÇÒ»¸öÖ÷Ì⣬ËüÕë¶ÔµÄ²¢²»ÊdzÌÐòÔ±£¬¶øÊǽçÃæÉè¼ÆÈËÔ±£¬ÈÃËûÃDz»±ØÕÆÎÕJava ֪ʶ±ãÄܹ»½øÐÐÏàÓ¦½çÃæµÄÑ¡Ôñ¶¨ÖÆ¡£²ÉÓÃÁËSynth ºó£¬ÎÒÃDz»ÄÜ´ÓÏÖÓÐÍâ¹Û»òÖ÷ÌâÅÉÉú×ÓÀà¡¢ÐÞ¸Ä×ÖÌå»òÑÕÉ«£¬¶øÊÇͨ¹ýתÔز»Í¬µÄXML ÎļþÒÔ´ïµ½¶ÔÏàÓ¦½çÃæµÄ¿ØÖÆ¡£ÆäʵÏÖ²½Öè°üÀ¨½«³ÌÐòÍâ¹ÛÉèÖóÉSynth ģʽÒÔ¼°±à¼Ïà¶ÔÓ¦µÄXML Îļþ¡£
ÉèÖÃSynthÍâ¹Ûģʽ,¿ÉÒÔʹÓÃÒÔÏ´úÂ룺
SynthLookAndFeel synth = new SynthLookAndFeel();
Class aClass = SynthTest.class;
InputStream is = aClass.getResourceAsStream("file1.xml");
synth.load(is, aClass);
UIManager.setLookAndFeel(synth);
¶ÔÓÚXML ÖеĴó¶àÊýÊÂÇéÀ´Ëµ£¬ÎļþµÄÄÚÈÝÓÉÎĵµÀàÐͶ¨Ò壨DTD£©ÃèÊö¡£Ö»ÒªÔÚXMLÎļþÖÐÃèÊö×é¼þ£¬È»ºó°ÑÎļþ´«¸øSynthLookAndFeel ʵÀýµÄload() ·½·¨£¬Ó¦ÓóÌÐòµÄÍâ¹Û¾Í»áÓÐËù²»Í¬¡£ÒÔÏÂÊÇXML ¿ØÖƳÌÐòÍâ¹ÛµÄ´úÂ룺
<?xml version="1.0" encoding="ISO-8859-1"?>
<synth>
<style id="button">
<font name="Dotum" size="24" style="BOLD"/>
<state value="MOUSE_OVER">
<font name="System" size="48" style="ITALIC"/>
</state>
</style>
<bind style="button" type="region" key="Button"/>
</synth>
ÒÔϸ½ÉÏSynth µÄÑÝʾ´úÂëSynthTest.java£¬ÓëÆäÏà¶ÔÓ¦µÄXML Îļþ¿ÉÑ¡ÓÃÉÏÃæµÄʾÀý´úÂ룬½«Æä¸üÃûΪsynth.xml ¼´¿É£º
import java.io.InputStream;
import java.text.ParseException;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.plaf.
Ïà¹ØÎĵµ£º
javaͬһÓû§µÇ¼ÎÊÌâ
1.ÉϸöÔÂÒ²ÓÐÌÖÂÛÕâ¸öÎÊÌâµÄ,ÓкöàÈ˶¼·¢±íÁËÒâ¼û,µ«Ò²Ã»Óбê×¼µÄ´ð°¸
ÎÒ¿´µ½Ò»¸ö,:½«SEssionID´æÈëDBÖÐ,µ±ÄãµÇ¼ʱ,Åжϵ±Ç°µÄSEssionIDºÍDB
ÀïÊDz»ÊÇͬһ¸ö,Èç¹û²»ÊÇ,˵Ã÷ÊǵڶþÈ˵ǼÁË,ÄǾͽ«DBÀïµÄSESSIONID×¢Ïú
È»ºóÔÙ´¦ÀíµÚ¶þ¸öµÇ¼.
2.ÔÚContextÖн¨Á¢Ò»¸öMap <String,Sission>,´ ......
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°ü·Å ......
7. ÓÃJavaXPCOMÀ´×Ô¶¯ä¯ÀÀÍøÒ³
ÔÚÕâÒ»½ÚÀïÎÒÃǽ«½â¾öһЩ×Ô¶¯ä¯ÀÀÍøÒ³ÖеÄһЩÎÊÌ⣬³¢ÊÔ°ÑÒ»ÏÂͨÓõÄÈÎÎñ³éÏó³ÉÈËÀà¿É¶ÁµÄ·½·¨£¬Òò´ËÄã¿ÉÒÔÇáÒ×µÄÔĶÁ
´úÂë²¢ÖªµÀËüµÄ¹¦ÄÜ¡£ÎÒÃǽ«¹¹½¨Ò»¸öWeb BrowserÀ´¼ÓÔØÍøÒ³£¬µã»÷°´Å¥»òÕß³¬Á´½Ó£¬Ê¹ÓÃXPathÀ´³éÈ¡Ò»ÏÂÓÐÓõÄÐÅÏ¢¡£ÔÚÿһ¸ö
С½ÚÀïÃ棬ÎÒÃǶ¼½«ÔÚÎÒÃǵ ......
¿ÉÒÔÓÃ×öcsdn±¸·Ý£¬Õâ¸ö·½·¨À©³äÒÔºó×ö¸öcsdn±¸·Ý¹¤¾ßµ¹ÊDz»´í
package com.tag;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import ja ......
½ñÈÕÔÚÍøÉÏżȻÅöµ½Ò»¸ö³õѧÕßµÄjavaÌâÄ¿£¬¾Í³¢ÊÔµÄ×öÁËһϣ¬µ«Ã»Ïëµ½Ò»×ö¾ÍÊǽӽüÒ»¸öÖÓÍ·°¡£¬¿´À´javaѧϰµÄ·ÉÏ»¹ÊÇ·ÂþÂþÙâÐÞÔ¶°¡¡£
ÌâÄ¿ÈçÏ£º
±àдһ¸öJava Application ³ÌÐò£¬½ÓÊÜÓû§ÊäÈëµÄÒ»¸ö¸¡µãÊý£¬½«ÆäµÄÕûÊý²¿·ÖºÍСÊý²¿·Ö·Ö±ðÊä³ö¡£
È磺ÊäÈë56.6 £¬ÔòÓÐ
¡¡¡¡¡¡¡¡¡¡¡¡ÕûÊý²¿·Ö£º56
¡¡¡¡¡¡¡¡¡¡¡¡ ......