当前位置: 技术问答>java相关
找不着TextEnent,endTag呀
来源: 互联网 发布时间:2017-04-04
本文导语: 我的KXML包中找不到TextEnent,endTag这两个类呀 | 给你个程序看看吧! import java.io.*; import java.util.*; import javax.microedition.lcdui.*; import javax.microedition.midlet.*; //import nanoxml.*; import org.kxml.*; import or...
我的KXML包中找不到TextEnent,endTag这两个类呀
|
给你个程序看看吧!
import java.io.*;
import java.util.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
//import nanoxml.*;
import org.kxml.*;
import org.kxml.parser.*;
/**
* Simple MIDlet that demonstrates how an XML document can be
* parsed using kXML or NanoXML.
*/
public final class XMLTestOK extends MIDlet {
// Our XML document -- normally this would be something you
// download.
private static String xmlDocument =
"apple" +
"orange" +
"pear";
private Display display;
private Command exitCommand = new Command( "Exit", Command.EXIT, 1 );
public XMLTestOK(){
}
protected void destroyApp( boolean unconditional )
throws MIDletStateChangeException {
exitMIDlet();
}
protected void pauseApp(){
}
protected void startApp() throws MIDletStateChangeException {
if( display == null ){ // first time called...
initMIDlet();
}
}
private void initMIDlet(){
display = Display.getDisplay( this );
String [] items;
//items = parseUsingNanoXML( xmlDocument );
items = parseUsingkXML( xmlDocument );
display.setCurrent( new ItemList( items ) );
}
public void exitMIDlet(){
notifyDestroyed();
}
// Parses a document using NanoXML, looking for
// "item" nodes and returning their content as an
// array of strings.
/*
private String[] parseUsingNanoXML( String xml ){
kXMLElement root = new kXMLElement();
try {
root.parseString( xml );
Vector list = root.getChildren();
Vector items = new Vector();
for( int i = 0; i
import java.io.*;
import java.util.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
//import nanoxml.*;
import org.kxml.*;
import org.kxml.parser.*;
/**
* Simple MIDlet that demonstrates how an XML document can be
* parsed using kXML or NanoXML.
*/
public final class XMLTestOK extends MIDlet {
// Our XML document -- normally this would be something you
// download.
private static String xmlDocument =
"apple" +
"orange" +
"pear";
private Display display;
private Command exitCommand = new Command( "Exit", Command.EXIT, 1 );
public XMLTestOK(){
}
protected void destroyApp( boolean unconditional )
throws MIDletStateChangeException {
exitMIDlet();
}
protected void pauseApp(){
}
protected void startApp() throws MIDletStateChangeException {
if( display == null ){ // first time called...
initMIDlet();
}
}
private void initMIDlet(){
display = Display.getDisplay( this );
String [] items;
//items = parseUsingNanoXML( xmlDocument );
items = parseUsingkXML( xmlDocument );
display.setCurrent( new ItemList( items ) );
}
public void exitMIDlet(){
notifyDestroyed();
}
// Parses a document using NanoXML, looking for
// "item" nodes and returning their content as an
// array of strings.
/*
private String[] parseUsingNanoXML( String xml ){
kXMLElement root = new kXMLElement();
try {
root.parseString( xml );
Vector list = root.getChildren();
Vector items = new Vector();
for( int i = 0; i
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
站内导航:
特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!