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
相关文档:
代码如下:
以下为引用的内容:
package com.example.pinyin.demo2;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.form ......
import java.util.LinkedList;
public abstract class Manager {
private String mThreadPoolName = null;
......
最佳答案
1. 编写范例文档
public class TestNative
{
private native static int Max(int a,int b);
public static void main(String[] args)
{
System.out.println(Max(4,5));
}
static
{
System.loadLibrary("VCdll");
}
}
其中
LoadLibrary中的DLL文件名称可以 ......
大家知道,在1991年,几乎与Linux同时,SUN发布了Java编程语言。不久,我的大学同学(比我低两年)王克宏教授(清华博士导师)与SUN合作成立了中国最早的“Java研究中心”,并且担任该中心主任。从此,我开始注意Java技术的发展动态。我家中的存书,以Java书籍最多(当然,除了数学书籍 ......
JXL的打印设置在jxl.SheetSettings这个类中,我们可以通过方法Sheet(或者WritableSheet)#getSettings()获取。
1.页面
1.1方向
SheetSetting#setOrientation(PageOrientation po);
参数: PageOrientation#LANDSCAPE 横向打印
PageOrientation# PO ......