Êý¾Ýת»»excelµÄjava³ÌÐò
ÒªÓõ½jxlµÄ°ü
¾ßÌåʵÀý
1.Éú³ÉexcelÎļþ
package com.createexcel;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import com.mysql.jdbc.ResultSetMetaData;
import jxl.Workbook;
import jxl.format.Colour;
import jxl.format.UnderlineStyle;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import com.bean.DataInfo;
public class CreateExcel {
public void CreateExcel(String targetfile,String start,String end) {
String worksheet = "ÈÕÖ¾Êä³ö"; //Êä³öµÄexcelÎļþ¹¤×÷±íÃû
GetDataInfo data=new GetDataInfo();
List list=new ArrayList();
list=data.getdata(start,end);
if(list.size()!=0){
int colCount=0;
TestDao test=new TestDao();
ResultSet rs = test.selectSql("SELECT * from datainfo");
WritableWorkbook workbook;
try{
System.out.println("begin");
//´´½¨¿ÉдÈëµÄExcel¹¤×÷±¡,ÔËÐÐÉú³ÉµÄÎļþÔÚtomcat/binÏÂ
//workbook = Workbook.createWorkbook(new File("output.xls"));
OutputStream os=new FileOutputStream(targetfile);
workbook=Workbook.createWorkbook(os);
WritableSheet sheet = wo
Ïà¹ØÎĵµ£º
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.RandomAccessFile;
/**
* ÃèÊö£º×·¼ÓÄÚÈݵ½Îļþĩβ
* @author Administrator
*
*/
public class ......
package ch01;
public class BubbleSort
{
public static void main(String[] args){
int[] values ={
&n ......
UIManager.setLookAndFeel(“
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
”);//windowsĬÈÏ
UIManager.put("MenuBar.font", font);//¸ø¿Ø¼þÉèÖÃ×ÖÌå
static Object
put
(Object
key, Object
value)
public static void setLookAndFeel(String className, jav ......
/***********Ryear.java begin********************/
import java.util.Scanner;
public class Ryear {
/**
* @param args
*/
public static void main(String[] args) {
/**
* ±àд³ÌÐò ......
Ò»¡¢Java±à³ÌÈëÃÅÀà
¶ÔÓÚûÓÐJava±à³Ì¾ÑéµÄ³ÌÐòÔ±ÒªÈëÃÅ£¬Ëæ±ã¶ÁʲôÈëÃÅÊé¼®¶¼Ò»Ñù£¬Õâ¸ö½×¶ÎÐèÒªÄã¿ìËÙµÄÕÆÎÕJava»ù´¡Óï·¨ºÍ»ù±¾Ó÷¨£¬×ÚÖ¼¾ÍÊÇ“àñàðÍÌÔæ²»ÇóÉõ½â”£¬ÏȶÔJavaÊìϤÆðÀ´ÔÙ˵¡£Óú̵ܶÄʱ¼ä¿ìËÙ¹ýÒ»±éJavaÓï·¨£¬Á¬ã´ø²Â¶àдд´úÂ룬Ҫ“ÖªÆäÈ»”¡£
1¡¢¡¶Java±à³Ì˼Ïë¡·
Ô ......