java²Ù×÷Excel£¨×ª£©
ʹÓÃWindows²Ù×÷ϵͳµÄÅóÓѶÔExcel£¨µç×Ó±í¸ñ£©Ò»¶¨²»»áÄ°Éú£¬µ«ÊÇҪʹÓÃJavaÓïÑÔÀ´²Ù×ÝExcelÎļþ²¢²»ÊÇÒ»¼þÈÝÒ×µÄÊ¡£ÔÚWebÓ¦ÓÃÈÕÒæÊ¢ÐеĽñÌ죬ͨ¹ýWebÀ´²Ù×÷ExcelÎļþµÄÐèÇóÔ½À´Ô½Ç¿ÁÒ£¬Ä¿Ç°½ÏΪÁ÷ÐеIJÙ×÷ÊÇÔÚJSP»òServlet Öд´½¨Ò»¸öCSV £¨comma separated values£©Îļþ£¬²¢½«Õâ¸öÎļþÒÔMIME£¬text/csvÀàÐÍ·µ»Ø¸øä¯ÀÀÆ÷£¬½Ó×Åä¯ÀÀÆ÷µ÷ÓÃExcel²¢ÇÒÏÔʾCSVÎļþ¡£ÕâÑùÖ»ÊÇ˵¿ÉÒÔ·ÃÎʵ½ExcelÎļþ£¬µ«ÊÇ»¹²»ÄÜÕæÕýµÄ²Ù×ÝExcelÎļþ£¬±¾ÎĽ«¸ø´ó¼ÒÒ»¸ö¾ªÏ²£¬Ïò´ó¼Ò½éÉÜÒ»¸ö¿ª·ÅÔ´ÂëÏîÄ¿£¬Java Excel API£¬Ê¹ÓÃËü´ó¼Ò¾Í¿ÉÒÔ·½±ãµØ²Ù×ÝExcelÎļþÁË¡£
JAVA EXCEL API¼ò½é
Java ExcelÊÇÒ»¿ª·ÅÔ´ÂëÏîÄ¿£¬Í¨¹ýËüJava¿ª·¢ÈËÔ±¿ÉÒÔ¶ÁÈ¡ExcelÎļþµÄÄÚÈÝ¡¢´´½¨ÐµÄExcelÎļþ¡¢¸üÐÂÒѾ´æÔÚµÄExcelÎļþ¡£Ê¹ÓøÃAPI·ÇWindows²Ù×÷ϵͳҲ¿ÉÒÔͨ¹ý´¿JavaÓ¦ÓÃÀ´´¦ÀíExcelÊý¾Ý±í¡£ÒòΪÊÇʹÓÃJava±àдµÄ£¬ËùÒÔÎÒÃÇÔÚWebÓ¦ÓÃÖпÉÒÔͨ¹ýJSP¡¢ServletÀ´µ÷ÓÃAPIʵÏÖ¶ÔExcelÊý¾Ý±íµÄ·ÃÎÊ¡£
Java Excel API Îĵµ
http://www.andykhan.com/jexcelapi/
1.Ó¦ÓÃʾÀý£º
ÈçºÎ´ÓExcel¶ÁÈ¡Êý¾Ý:
package com.etong.allen;
import java.io.*;
import java.util.*;
import com.roger.util.StringUtil;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
/** *//**
* <p>Title: </p>
* <pre>Description: ExcelÊý¾Ýµ¼Èëµ½oracleÊý¾Ý¿âÀà.
* </pre>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: Ò×ͨ¼¼ÊõÓÐÏÞ¹«Ë¾</p>
* @author Allen
* @version 1.0
*/
public class ExcelImportOracle ...{
/** *//**
* ÓÃÓÚ·µ»ØÈýάÊý×éµÄArrayList.
*/
private static ArrayList subdata = new ArrayList();
/** *//**
* ExcelÖеıíÃû.
*/
private static String tablename;
/** *//**
* ÎļþµÄ·¾¶
*/
private static String filePath;
/** *//**
* ¸Ã·½·¨ÎªÍê³É¶ÁÈ¡ExcelÖеÄÊý¾Ý²¢½«Êý¾Ý²åÈëµ½¶ÔÓ¦µÄÊý¾Ý¿â±íÖеIJÙ×÷(ÔÚµ÷ÓÃÇ°ÐèÒªÏȵ÷ÓÃsetFilePath(String)Õâ¸ö·½·¨.).
* @author Administrator
* @param data:¶ÁÈ¡ExcelÖеÄÊý¾ÝµÄÊý×é.
* @deprecated:½«¶ÁÈ¡Exce
Ïà¹ØÎĵµ£º
×î½ü×öÒ»¸öÏîÄ¿£¬ÒªÓõ½·ÖÒ³¹¦ÄÜ£¬²Î¿¼Á˺ܶ෽·¨£¬ÓеIJ»ºÏÊÊ£¬ÓеIJ»Ï²»¶£¬ÓÚÊÇ×Ô¼ºÔÚËûÃǵĻù´¡ÉÏÕûÁËÒ»¸ö£»Ë¼Â·ÊÇÕâÑùµÄ£ºÏÈ°ÑÐèÒª·ÖÒ³µÄÊý¾Ý»òÊǼǼ¶¼²éѯ³öÀ´ ´æÈëÒ»¸ö¼¯ºÏÀàÀïÈçList»òÊÇVector£¬È»ºóÀûÓÃÆäsublist(int findex,int eindex)·½·¨£¬»ñÈ¡ÐèÒª·ÖÒ³µÄÊý¾Ý»ò¼Ç¼,¹ØÓ ......
String ×Ö·û´®³£Á¿
StringBuffer ×Ö·û´®±äÁ¿£¨Ḭ̈߳²È«£©
StringBuilder ×Ö·û´®±äÁ¿£¨·ÇḬ̈߳²È«£©
¼òÒªµÄ˵£¬ String ÀàÐÍºÍ StringBuffer ÀàÐ͵ÄÖ÷ÒªÐÔÄÜÇø±ðÆäʵÔÚÓÚ String ÊDz»¿É±äµÄ¶ÔÏó, Òò´ËÔÚÿ´Î¶Ô String ÀàÐͽøÐиıäµÄʱºòÆäʵ¶¼µÈͬÓÚÉú³ÉÁËÒ»¸öÐ嵀 String ¶ÔÏó£¬È»ºó½«Ö¸ÕëÖ¸ÏòÐ嵀 String ¶ÔÏó£¬ËùÒÔ¾ ......
±¾ÎÄΪԴ´£¬ÈçÐèתÔØ£¬Çë×¢Ã÷×÷Õߺͳö´¦£¬Ð»Ð»£¡
Ëõ·ÅͼÏñµÄ»ù±¾ÔÀíÊÇ´´½¨Ò»¸öÄ¿±ê´óСµÄ»²¼£¬È»ºó¶ÁȡԴͼÏñ£¬²¢½«¸ÃͼÏñ»æÖÆÕâ¸ö»²¼ÉÏ¡£ÎªÁËʹ³ÌÐòͨÓã¬Ô´Í¼ÏñºÍËõ·ÅºóµÄÄ¿±êͼÏñÓ¦Ó÷ֱðʹÓÃ
InputStreamºÍOutputStreamÀ´±íʾ£¬´úÂëÈçÏ£º
public
stat ......
¡¡ÔÚJavaÓïÑÔÖУ¬ abstract class ºÍinterface ÊÇÖ§³Ö³éÏóÀඨÒåµÄÁ½ÖÖ»úÖÆ¡£ÕýÊÇÓÉÓÚÕâÁ½ÖÖ»úÖƵĴæÔÚ£¬²Å¸³ÓèÁËJavaÇ¿´óµÄ ÃæÏò¶ÔÏóÄÜÁ¦¡£abstract classºÍinterfaceÖ®¼äÔÚ¶ÔÓÚ³éÏóÀඨÒåµÄÖ§³Ö·½Ãæ¾ßÓкܴóµÄÏàËÆÐÔ£¬ÉõÖÁ¿ÉÒÔÏ໥Ìæ»»£¬Òò´ËºÜ¶à¿ª·¢ÕßÔÚ½ø ÐгéÏóÀඨÒåʱ¶ÔÓÚabstract classºÍinterfaceµÄÑ¡ÔñÏԵñȽÏËæ ......
package java;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.*;
public class fontnameDome extends JFrame implements ActionListen ......