Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java²Ù×÷Excel

½«ÏÂÔغóµÄÎļþ½â°ü£¬µÃµ½jxl.jar£¬·ÅÈëclasspath£¬°²×°¾ÍÍê³ÉÁË¡£
»ù±¾²Ù×÷
Ò»¡¢´´½¨Îļþ
ÄâÉú³ÉÒ»¸öÃûΪ“²âÊÔÊý¾Ý.xls”µÄExcelÎļþ£¬ÆäÖеÚÒ»¸ö¹¤×÷±í±»ÃüÃûΪ“µÚÒ»Ò³”£¬´óÖÂЧ¹ûÈçÏ£º
´úÂ루CreateXLS.java£©£º
//Éú³ÉExcelµÄÀà
import java.io.*;
import jxl.*;
import jxl.write.*;
public class CreateXLS
{
public static void main(String args[])
{
try
{
//´ò¿ªÎļþ
WritableWorkbook book=
Workbook.createWorkbook(new File(“²âÊÔ.xls”));
//Éú³ÉÃûΪ“µÚÒ»Ò³”µÄ¹¤×÷±í£¬²ÎÊý0±íʾÕâÊǵÚÒ»Ò³
WritableSheet sheet=book.createSheet(“µÚÒ»Ò³”,0);
//ÔÚLabel¶ÔÏóµÄ¹¹Ôì×ÓÖÐÖ¸Ãûµ¥Ôª¸ñλÖÃÊǵÚÒ»ÁеÚÒ»ÐÐ(0,0)
//ÒÔ¼°µ¥Ôª¸ñÄÚÈÝΪtest
Label label=new Label(0,0,”test”);
//½«¶¨ÒåºÃµÄµ¥Ôª¸ñÌí¼Óµ½¹¤×÷±íÖÐ
sheet.addCell(label);
/*Éú³ÉÒ»¸ö±£´æÊý×ֵĵ¥Ôª¸ñ
±ØÐëʹÓÃNumberµÄÍêÕû°ü·¾¶£¬·ñÔòÓÐÓï·¨ÆçÒå
jxl.write.Number number = new jxl.write.Number(1,0,789.123);
sheet.addCell(number);
//дÈëÊý¾Ý²¢¹Ø±ÕÎļþ
book.write();
book.close();
}catch(Exception e)
{
System.out.println(e);
}
}
}
¶þ¡¢¶ÁÈ¡Îļþ
ÒÔ¸Õ²ÅÎÒÃÇ´´½¨µÄExcelÎļþΪÀý£¬×öÒ»¸ö¼òµ¥µÄ¶ÁÈ¡²Ù×÷£¬³ÌÐò´úÂëÈçÏ£º
³ÌÐò´úÂë
//¶ÁÈ¡ExcelµÄÀà
import java.io.*;
import jxl.*;
public class ReadXLS
{
public static void main(String args[])
{
try
{
Workbook book=
Workbook.getWorkbook(new File(“²âÊÔ.xls”));
//»ñµÃµÚÒ»¸ö¹¤×÷±í¶ÔÏó
Sheet sheet=book.getSheet(0);
//µÃµ½µÚÒ»ÁеÚÒ»Ðеĵ¥Ôª¸ñ
Cell cell1=sheet.getCell(0,0);
String result=cell1.getContents();
System.out.println(result);
book.close();
}catch(Exception e)
{
System.out.println(e);
}
}
}
       ³ÌÐòÖ´Ðнá¹û£ºtest
         Èý¡¢ÐÞ¸ÄÎļþ
               ÀûÓÃjExcelAPI¿ÉÒÔÐÞ¸ÄÒÑÓеÄExcelÎļþ£¬ÐÞ¸ÄExcelÎļþµÄʱºò£¬³ýÁË´ò¿ªÎļþµÄ·½Ê½²»Í¬Ö®Í⣬ÆäËû²Ù×÷ºÍ´´½¨ExcelÊÇÒ»ÑùµÄ¡£ÏÂÃæµÄÀý×ÓÊÇÔÚÎÒÃÇÒѾ­Éú


Ïà¹ØÎĵµ£º

£¨Àý£©JavaÉú³ÉPDF±¨±í iText

// µ¼Èë£É£Ï¿âÀà
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
// µ¼Èë¡¡£Ð£Ï£É¿âÀà
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi ......

Êý¾Ý¿â¿ª·¢ÕâµãÊ Java¿ìËÙÈëÃÅ£­¼ò½é

È«±¾¡¶Êý¾Ý¿â¿ª·¢ÕâµãÊÂ-Java¿ìËÙÈëÃÅ¡·Ãâ·ÑÏÂÔØ
À´×Ô£ºhttp://zyt.howwe.net/me.php?320
Ŀ¼£ºhttp://zyt.howwe.net/ok.php?321
 
ÄÚÈݼò½é
¡¡¡¡Õë¶ÔJava³õѧÕß¼°ÈëÃÅÕߣ¬ÏµÍ³²ûÊöWeb¿ª·¢»ù±¾ÖªÊ¶£¬½áºÏÊý¾Ý¿âµÄ¿ìËÙÓ¦Óã¬Ê¹¶ÁÕß¿ìËÙ¿çÈëJavaÁìÓò£¬¶Ô±à³ÌÓïÑÔ²»ÔÙη¾å¡£¸ÃÊé×÷Ϊ¡¶´ÓÈËÉúÐèÒªÒýµ¼ÂÛJava¿ìËÙ¿ª·¢ ......

java ²éѯ¿ÉÓÃÓòÃû

Õâ¶Îʱ¼äÔÚ×¢²áÓòÃû£¬ÔÛÆð²½Íí£¬ºÃÓõÄÓòÃû¶¼¸ø±ðÈË×¢²áÁË¡£
ÏëÕÒ¸öλÊýÉÙµÄ.comÓòÃû£¬¿ÉÊÇ·¢Ïִ󲿷ֶ¼×¢²áÁË£¬Ò²¾ÍÊÇ˵£¬ÎÒµã»÷µÄ¶à´Î²éѯ¶¼ÊÇÀË·Ñ¿¨Â·ÀÎҿɲ»Ïë¼õ·Ê£©
ÓÚÊÇ»¨Á˵ãʱ¼ä£¬ÓÃjavaдÁ˸ö¸ù¾ÝÖ¸¶¨Î»Êý²éѯËùÓпÉÓõÄ.comÓòÃûµÄС³ÌÐò¡£ÌṩԴÂëÏÂÔØ¡£
ÎÒÀûÓõÄÊÇwhoisÕâ¸öÓòÃû²éѯÍøվȡµÃÊý¾Ý£¬ÔÚ²âÊÔµ ......

javaʵÏÖÑéÖ¤Âë

javaÑéÖ¤ÂëµÄʵÏÖ(Ò»)
ÊÕ²Ø



1.ImageServletÀàµÄʵÏÖ£º
package com.mobile.control;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOExcep ......

ZlibѹËõËã·¨ÔÚjavaÉϵÄÓ¦ÓÃ

JAVAʵÏÖ
¡¡¡¡ÔÚJDKÖУ¬ÔÚjava.util.zip°üÖÐÒѾ­ÄÚÖÃÁËZLIBµÄʵÏÖ£¬Ê¾Àý´úÂëÈçÏ£º
1//½âѹ
2 public String decompressData(String encdata) {
3 try {
4 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
5 InflaterOutputStream zos = new InflaterOutputStream(bos); 
6 zo ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ