java´¦Àí Excel(POI°ü)
×î½üÔÚÔÛÃÇÕâ¸öÂÛ̳Àï×ÜÄÜ¿´¼û´ó¼ÒÌá³öÓÃjava´¦ÀíExcelµÄÎÊÌ⣬ÓÐʱ»¹Éæ¼°µ½Í¼ÐεÄÎÊÌ⣬
´ó¼Ò¿´ÁËÕâƪÎÄÕºó£¬ÎÒÏëÒ»¶¨»á½â¾ö²»ÉÙÈ˵ÄÎÊÌ⣡
¿´µ½ÍøÉϺܶàÎÄÕ¶¼Ò»Ö±¶¼ÊÇ˵POIµÄAPI²»ÄÜ´¦ÀíͼÐΣ¬Ò²¾ÍÊDz»ÄÜÍùExcelÀïÃæ¼ÓÈëͼÐΡ£
µ«ÊÂʵÉÏ£¬POI3.0³öÀ´Ö®ºó£¬Õâ¸öÎÊÌâÒѾ½â¾ö£¡ËùÒÔ˵£¬ÍùExcelÀïÃæ¼ÓÈëͼÐβ»±ØÒ»¶¨ÇóÖúÓÚJAVA EXCEL APIÁË¡£
×î½üÔÚһλ´ïÈ˵ÄÆô·¢Ï£¬ÖÕÓÚ½â¾öÁËÕâ¸öÎÊÌ⣬¾Í´Ë£¬Ð´ÏÂÕâЩ£¬Èç¹ûÓÐÈË¿´µ½µÄ»°£¬Ò²Ï£ÍûÄܶÔËûÓеã°ïÖú°É¡£
´úÂ룺
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet();
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
BufferedImage bufferImg = ImageIO.read(new File("D:\\fruit.PNG"));
ImageIO.write(bufferImg,"PNG",byteArrayOut);
HSSFClientAnchor anchor =
new HSSFClientAnchor(5,0,500,122,(short) 0, 5,(short)10,15);
HSSFPatriarch patri = sheet.createDrawingPatriarch();
patri.createPicture(anchor ,
wb.addPicture(byteArrayOut.toByteArray(),
HSSFWorkbook.PICTURE_TYPE_PNG));
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
wb.write(outStream);
ÉÏÃæ´úÂëÖ»ÊÇ´ó¸Å£¬µ«ÐèÒªÓõ½µÄÀ඼ÒѾÁгö¡£½ÓÏÂÀ´ÐèÒª×öµÄ¾ÍÊÇ°Ñ outStreamÊä³öµ½excelÎļþÖÐÈ¥ÁË¡£
¾ßÌåµÄÀàµÄdocument¿ÉÒÔÈ¥ÏÂÃæÍøÕ¾Éϲ鿴:
http://jakarta.apache.org/poi/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html
Ïà¹ØÎĵµ£º
JAVAÓïÑÔÖеķ´Éä»úÖÆ£º
ÔÚJava ÔËÐÐʱ »·¾³ÖУ¬¶ÔÓÚÈÎÒâÒ»¸öÀ࣬ÄÜ·ñÖªµÀÕâ¸öÀàÓÐÄÄЩÊôÐԺͷ½·¨£¿
¶ÔÓÚÈÎÒâÒ»¸ö¶ÔÏó£¬ÄÜ·ñµ÷ÓÃËûµÄ·½·¨£¿ÕâЩ´ð°¸Êǿ϶¨µÄ£¬ÕâÖÖ¶¯Ì¬»ñÈ¡ÀàµÄÐÅÏ¢£¬ÒÔ¼°¶¯Ì¬µ÷ÓÃÀàµÄ·½·¨µÄ¹¦ÄÜÀ´Ô´ÓÚJAVAµÄ·´Éä¡£´Ó¶øʹjava¾ßÓж¯Ì¬ÓïÑÔµÄÌØÐÔ¡£
JAVA·´É ......
µÚÒ»£¬Ì¸Ì¸final, finally, finalizeµÄÇø±ð¡£
¡¡¡¡×î³£±»Îʵ½¡£¡¡¡¡
¡¡¡¡µÚ¶þ£¬Anonymous Inner Class (ÄäÃûÄÚ²¿Àà) ÊÇ·ñ¿ÉÒÔextends(¼Ì³Ð)ÆäËüÀ࣬ÊÇ·ñ¿ÉÒÔimplements(ʵÏÖ)interface(½Ó¿Ú)?¡¡¡¡
¡¡¡¡µÚÈý£¬Static Nested Class ºÍ Inner ClassµÄ²»Í¬£¬ËµµÃÔ½¶àÔ½ºÃ(ÃæÊÔÌâÓеĺÜÁýͳ)¡£¡¡¡¡
¡¡¡¡µÚËÄ£¬&ºÍ&am ......
±¾ÎĽéÉÜJavaµÄBigDecimalÀàµÄÓ¦Óá£JavaÔÚjava.math°üÖÐÌṩµÄAPIÀàBigDecimal£¬ÓÃÀ´¶Ô³¬¹ý16λÓÐЧλµÄÊý½øÐо«È·µÄÔËËã¡£
BigDecimalÀà
Ë«¾«¶È¸¡µãÐͱäÁ¿double¿ÉÒÔ´¦Àí16λÓÐЧÊý¡£ÔÚʵ¼ÊÓ¦ÓÃÖУ¬ÐèÒª¶Ô¸ü´ó»òÕ߸üСµÄÊý½øÐÐÔËËãºÍ´¦Àí¡£JavaÔÚjava.math°üÖÐÌṩµÄAPIÀàBigDecimal£¬ÓÃÀ´¶Ô³¬¹ý16λÓÐЧλµÄÊý½øÐо«È· ......
package homework02;
import java.util.Scanner;
/*
* ±àдÁ½¸öÀࣺAºÍB£¬ÀàA´´½¨µÄ¶ÔÏó¿ÉÒÔ¼ÆËãÁ½¸öÕýÕûÊýµÄ×î´ó¹«Ô¼Êý£¬ÀàB´´½¨µÄ
* ¶ÔÏó¿ÉÒÔ¼ÆËãÁ½¸öÊýµÄ×îС¹«±¶Êý¡£ÒªÇó£ºÀàBÖÐÓÐÒ»¸ö³ÉÔ±±äÁ¿Ê±ÓÃÀàAµÄÉùÃ÷¶ÔÏó¡£
*/
public class A {
private int m;
private int n;
public A(){
this.intput();
......
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
Categories of Java HotSpot VM Options
Standard options recognized by the Java HotSpot VM are described on the Java Application Launcher reference pages for Windows
, Solaris
and Linux
. This document deals exclusively wit ......