易截截图软件、单文件、免安装、纯绿色、仅160KB

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


相关文档:

JAVA中数据库连接池的动态实现

     (一)程序开发,存在很多问题:首先,每一次Web请求都要建立一次数据库连接。建立连接是一个费时的活动,每次都得花费0.05s~1s的时间,而且系统还要分配内存资源。这个时间对于一次或几次数据库操作,或许感觉不出系统有多大的开销。可是对于现在的Web应用,尤其是大型电子商务网站,同时有几 ......

java调用dll例子


最佳答案
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文件名称可以 ......

Java 设计模式(12)

Observer
Intent
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
How to
Subject
  
knows its observers. Any number of Observer objects may observe a subject.
  
provides an in ......

Java对象XML序列化框架-Simple2.0


Java对象XML序列化框架-Simple2.0


Simple是一个XML序列化框架,一个Java
版本宽容的序列化框架,能够快速在Java
平台上开发XML。支持通过annotations完全配置化的XML结构;提供版本管理框架允许向前和向后兼容序列化;更好的性能,使用轻量级StAX提升XML反序列化
进程,比XStream和JAXB更快;通过namespace ......

使用JAVA通过JXL(JExcel)动态生成Excel文件


 
上次談過了使用iText產生PDF檔,這次換成來談談使用JExcel來產生EXCEL檔的方法。
首先,先到他的SourceForge主頁面download相關的API檔案。
http://sourceforge.net/projects/jexcelapi/

http://www.andykhan ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号