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
Ïà¹ØÎĵµ£º
<!--
/* 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 ......
package fileIo;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
public&nb ......
1.ǰÑÔ£º
ÄãµÄ³ÌÐò×ÜÓÐÒ»Ìì»á±ÀÀ£µô£¬ÔÚ±ÀÀ£µôµÄʱºòÎÒÃÇÒªÖªµÀËüÔÚÄÄ£¬ÎªÁËʲô¶ø±ÀÀ£µô£¬Êý¾ÝµÄ±£´æ»òÕß¶ªÊ§Çé¿öÈçºÎµÈÎÊÌâ¡£ÎÒÃÇ¿ÉÒÔͨ¹ý¼Ì³ÐÀàjava.lang.ThrowableµÄ×ÓÀࣺExceptionÀ´Éè¼ÆÎÒÃÇ×Ô¼ºµÄJavaÒì³£¡£ExceptionÀàÓÃÓÚÃèÊö³ÌÐòÄܹ»²¶»ñµÄÒì³££¬ÈçClassNotFoundException¡£Òª×¢ÒâµÄÊÇ×Ô¶¨ÒåÒì³£ÀàÖ®¼äÒ²¿ÉÒÔÓм ......
¹ØÓÚ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 ......
import java.util.LinkedList;
public abstract class Manager {
private String mThreadPoolName = null;
......