易截截图软件、单文件、免安装、纯绿色、仅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 异常Exception 集


<!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:宋体;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@SimSun&qu ......

RedHat AS4配置Java环境

到Sun网站下载自解压安装包jdk-xxxx.bin
安装:
[root@RHEL4 JDK-1.5.0.06]# chmod +x jdk-xxxx.bin
[root@RHEL4 JDK-1.5.0.06]# ./jdk-xxxx.bin
选择安装位置,
J2SDK安装目录: /usr/local/jdk
配置Java环境变量:
在 ~/.bash_profile 里加入下列几行环境变量即可:
export JAVA_HOME=/usr/local/jdk
export PAT ......

关于java的集合类,以及HashMap中Set的用法!


关于java的集合类,以及HashMap中Set的用法!
2005-10-22 14:47:43 Sat | 阅读(547)次
package com.tiantian;
import java.util.*;
public class JAVAContainer {
     public static void main(String[] args) throws Exception {
         //&nbs ......

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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号