java 解析 office系列文档
参考:
http://danadler.com/jacob/
http://jakarta.apache.org/poi/
http://www.onjava.com/pub/a/onjava/2003/01/22/poi.html
http://www.csdn.net/develop/article/15/15311.shtm
http://forum.java.sun.com/thread.jsp?forum=40&thread=382666&tstart=0&trange=15
Java Excel API 文档
http://www.andykhan.com/jexcelapi/
1、一个jacob操作Word的例子,其他操作excel,pdf的sample里都有
import java.io.File;
import com.jacob.com.*;
import com.jacob.activeX.*;
public class WordTest {
public static void main(String[] args) {
WordBean word=new WordBean();
word.openWord(true);
word.createNewDocument();
word.insertText("Hello word.");
}
}
import com.jacob.activeX.*;
import com.jacob.com.*;
public class WordBean extends java.awt.Panel
{
private ActiveXComponent MsWordApp = null;
private Dispatch document = null;
public WordBean()
{
super();
}
public void openWord(boolean makeVisible)
{
//Open Word if we've not done it already
if (MsWordApp == null)
{
MsWordApp = new ActiveXComponent("Word.Application");
}
//Set the visible property as required.
Dispatch.put(MsWordApp, "Visible",
new Variant(makeVisible));
}
public void createNewDocument()
{
//Find the Documents collection object maintained by Word
Dispatch documents =
Dispatch.get(MsWordApp,"Documents").toDispatch();
//Call the Add method of the Documents collection to create
//a new document to edit
document = Dispatch.call(documents,"Add").toDispatch();
}
public void insertText(String textToInsert)
{
// Get the current selection within Word at the moment. If
// a new document has just been created then this will be at
// the
相关文档:
File f=new File("DerectoryName");
String []results=f.list();
import java.io.*;
public class listFile
{ &nb ......
大家知道,在1991年,几乎与Linux同时,SUN发布了Java编程语言。不久,我的大学同学(比我低两年)王克宏教授(清华博士导师)与SUN合作成立了中国最早的“Java研究中心”,并且担任该中心主任。从此,我开始注意Java技术的发展动态。我家中的存书,以Java书籍最多(当然,除了数学书籍 ......
自己在做这个程序的时候看过很多的资料,上网也查了不少的资料,可是多半说的是出神入化,云里雾里...不光看了不明白,而且是有明白一点的人,看了也变的有些模糊了。
这里我掩饰一套完整的java jdbc 连接Oracle9i的范例。
package com.lxh.dbcon;//打包
import ......
1. 首先String不属于8种基本数据类型,String是一个对象。
因为对象的默认值是null,所以String的默认值也是null;但它又是一种特殊的对象,有其它对象没有的一些特性。
2. new String()和new String(“”)都是申明一个新的空字符串,是空串不是null;
3. String str=”kvill”;
......