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

JAVA³õÈëÃÅ——ʹÓÃJDOM´¦ÀíXML

½ñÌìÓÃÁËÒ»ÏÂJAVAÖеÄJDOM£¬JDOM ÊÇÒ»ÖÖʹÓà XML µÄ¶ÀÌØ Java ¹¤¾ß°ü£¬ÓÃÓÚ¿ìËÙ¿ª·¢ XML Ó¦ÓóÌÐò¡£
ÔÚÒÔÏÂÕâÀïÄܹ»¿´µ½¸üÏêϸµÄ¶ÔJDOMµÄ½éÉÜ£º
http://www.ibm.com/developerworks/cn/java/j-jdom/
ÏÂÃæÊÇÎÒ×Ô¼ºµÄ¹ØÓÚдXMLÎļþ¼°¶ÁXMLÎļþµÄ´úÂ룺
дXMLÎļþ
import org.jdom.*;
import org.jdom.output.XMLOutputter;
import java.io.*;
/**
*
* @author heqichang
*
* */
public class Jdom_t1 {
public static void main(String[] args)
{
//´´½¨¸ù½Úµã
Element root=new Element("MyInfo");

Element info=new Element("Info");
root.addContent(info);

//´´½¨×Ó½ÚµãÐÅÏ¢
Element name=new Element("name");
name.addContent("heqichang");
Element age=new Element("age");
age.addContent("24");
Element gender=new Element("gender");
gender.addContent("male");

info.addContent(name);
info.addContent(age);
info.addContent(gender);

//´´½¨Ò»¸öDocument
Document doc=new Document(root);

XMLOutputter outer=new XMLOutputter();
try {
//±£´æXMLÎļþ
FileWriter fw=new FileWriter("C:\\Users\\heqichang\\Desktop\\a.xml");
outer.output(doc, fw);
fw.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

XMLÎļþ½á¹¹
 
¶ÁXMLÎļþ 
import java.io.*;
import java.util.*;
import org.jdom.*;
import org.jdom.input.SAXBuilder;
/**
*
* @author heqichang
*
* */
public class ReadXml {
public static void main(String[] args)
{

try {
//ʹÓà SAXBuilder ¶Ô XML Îļþ½øÐÐÓï·¨·ÖÎö£¬²¢½«Ëüµ¼Èë³ÌÐòÖÐ
SAXBuilder builder=new SAXBuilder();
Document doc=builder.build(new File("C:\\Users\\heqichang\\Desktop\\a.xml"));

Element root=doc.getRootElement();

List list=root.getChildren();
for(int i=0;i<list.size();i++)
{
System.out.println("name£º"+((Element)list.get(i)).getChildText("name"));
System.out.println("age£º"+((Element)list.get(i)).getChildText("age"));
System.out.println("gender£º"+((Element)


Ïà¹ØÎĵµ£º

JavaÖÐÀàÓëÀàµÄ¹Øϵ

ÀàÓëÀàÖ®¼ä´æÔÚÒÔϹØϵ£º
1¡¢ ·º»¯(Generalization)
ºÜ¼òµ¥£¬¾ÍÊÇÎÒÃdz£ËµµÄ¼Ì³Ð¡£ÊÇ˵×ÓÀà»ñµÃ¸¸ÀàµÄ¹¦ÄܵÄͬʱ£¬»¹¿ÉÒÔÀ©Õ¹×Ô¼ºµÄ¹¦ÄÜ¡£
Èçͼ:
Java´úÂëÖбíÏÖΪ£ºextends ºÍ implements
2¡¢ ÒÀÀµ(Dependency)
Á½¸öÏà¶Ô¶ÀÁ¢µÄßËßË(AºÍB)£¬µ±A¸ºÔð¹¹ÔìBʱ£¬AÓëBÐγÉÒÀÀµ¹Øϵ£¬¼´AʹÓÃB¡£
Èçͼ£º
Java´úÂëÖеıíÏÖ ......

java ÊÂÎñÏÝÚå

ÕâƪÎÄ×ÖдµÄºÜºÃ£¬ÍƼö¸ø×Ô¼ººÍ´ó¼Ò£¡
ÊÂÎñ²ßÂÔ: Á˽âÊÂÎñÏÝÚå
ÔÚ Java ƽ̨ÖÐʵÏÖÊÂÎñʱҪעÒâµÄ³£¼û´íÎó
 
 
 
¼¶±ð£º Öм¶
Mark Richards, Ö÷¹ÜºÍ¸ß¼¶¼¼Êõ¼Ü¹¹Ê¦, Collaborative Consulting, LLC
2009 Äê 3 ÔÂ 06 ÈÕ
ÊÂÎñ´¦ÀíµÄÄ¿±êÓ¦¸ÃÊÇʵÏÖÊý¾ÝµÄ¸ß¶ÈÍêÕûÐÔºÍÒ»ÖÂÐÔ¡£±¾ÎÄÊÇΪ Java ƽ̨¿ª· ......

JavaÈռǣ¨Ò»£©——javaÈëÃÅ

javaÈëÃÅ
Ò»¡¢javaÊÇʲô
javaÊÇÒ»ÖÖ¼ÆËã»ú±à³ÌÓïÑÔ£¬Èí¼þ¿ª·¢Æ½Ì¨£¬Èí¼þÔËÐÐƽ̨£¬»¹ÊÇÒ»ÖÖÈí¼þ²¿Êð»·¾³¡£
¶þ¡¢javaÓÐʲô
java¼¼ÊõÓÐÈý¸ö·ÖÖ§£ºJava SE¡¢Java EEºÍJava ME¡£
Èý¡¢javaÄܸÉʲô
Ö÷ÒªÓÐÈý¸ö·½Ã棺×ÀÃæÓ¦ÓóÌÐòµÄ¿ª·¢¡¢ÆóÒµ¼¶µÄÓ¦ÓúÍǶÈëʽÉ豸¡£
ËÄ¡¢javaµÄÌصã
javaÊÇÒ»ÖÖ¼òµ¥µÄ¡¢ÃæÏò¶ÔÏóµÄ¡¢·Ö² ......

һƪ²»´íµÄ½éÉÜJava Socket±à³ÌµÄÎÄÕÂ

 
ÊÂʵÉÏÍøÂç±à³Ì¼òµ¥µÄÀí½â¾ÍÊÇÁ½Ì¨¼ÆËã»úÏ໥ͨѶÊý¾Ý¶øÒÑ¡£¶ÔÓÚ³ÌÐòÔ±¶øÑÔ£¬È¥ÕÆÎÕÒ»ÖÖ±à³Ì½Ó¿Ú²¢Ê¹ÓÃÒ»ÖÖ±à³ÌÄ£ÐÍÏà¶Ô¾Í»áÏԵüòµ¥µÄ¶àÁË¡£Java SDKÌṩһЩÏà¶Ô¼òµ¥µÄApiÀ´Íê³ÉÕâЩ¹¤×÷£¬Socket¾ÍÊÇÆäÖÐÖ®Ò»¡£
¶ÔÓÚJava¶øÑÔ¡£ÕâЩApi´æÔÚÓëJava.netÕâ¸ö°üÀïÃæ¡£Òò´ËÖ»Òªµ¼ÈëÕâ¸ö°ü¾Í¿ÉÒÔ×¼±¸ÍøÂç±à³ÌÁË¡£ÍøÂç± ......

java²Ù×÷pdf£¨½â¾öÖÐÎĵ¼³öÎÊÌ⣩


Java iText ¶¯Ì¬ Éú³É PDF Îĵµ ±í¸ñ ÖÐÎÄÎÊÌâ
 
iTextÊÇÒ»¸ö¿ª·¢Ô´´úÂëµÄÏîÄ¿£¬Äã¿ÉÒÔʹÓÃiText·½±ãµÄʵÏÖPDFµÄÊä³ö¡£
 
 
Ò»¡¢iTextµÄÏÂÔØ£º
    Äã¿ÉÒÔÔÚ http://www.lowagie.com/iText/ ²é¿´¹ØÓÚiTextµÄÏà¹ØÐÅÏ¢£¬°üÀ¨Ô´´úÂ룬Îĵµ..
    1. itext-src-1.4 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ