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 ......
¹ØÓÚ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 ......
×î¼Ñ´ð°¸
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ÎļþÃû³Æ¿ÉÒÔ ......
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 ......
¹¤×÷ÒѾÓаëÄêÁË£¬Í»È»Ïëдµã¶«Î÷£¬´óѧµÄʱºò¾ÍÓÐдÈռǵÄϰ¹ß£¬µ«ÊÇ×Ô´ÓÈ¥Java06°àѧϰһֱµ½ÏÖÔÚ¹¤×÷£¬ÂýÂýµÄҲûÓÐʱ¼äȥдÈռǣ¬Ï£Íûͨ¹ýÕâÆªÎÄÕÂÄÜÈÃJava˽ÛÓµÄѧµÜѧÃÃÃÇ¿´ÁËÓÐËù°ïÖú¡£
ÏàÐźܶàͬѧºÜÎÒÒ»Ñù´óËĵÄʱºò¶¼±È½ÏÃÔ㣬ÓÈÆäÊÇÎÒ¶ÁµÄ¼ÆËã»úרҵ£¬ËµÊµ»°´óѧÀïѧµÄºÍÉç»áʵ¼ÊÐèÒªµÄ» ......