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

java²Ù×÷Excel

// ´´½¨Excel
    String destFileName = tableName + ".xls";//ÎļþÃû
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment; filename=".concat(String .valueOf(destFileName)));
    
WorkbookSettings wbs = new WorkbookSettings();
    WritableWorkbook w = Workbook.createWorkbook(response .getOutputStream(), wbs);//´ò¿ªÎļþ
    jxl.write.WritableSheet ws = w.createSheet("sheet0", 0);// // Éú³ÉÃûΪ“sheet0”µÄ¹¤×÷±í£¬²ÎÊý0±íʾÕâÊǵÚÒ»Ò³   
   // ÔÚLabel¶ÔÏóµÄ¹¹Ôì×ÓÖÐÖ¸Ãûµ¥Ôª¸ñλÖÃÊǵÚÒ»ÁеÚÒ»ÐÐ(0,0)
   // ÒÔ¼°µ¥Ôª¸ñÄÚÈÝΪtest
   Label label = new Label(0, 0, "test123");
  
   // ½«¶¨ÒåºÃµÄµ¥Ôª¸ñÌí¼Óµ½¹¤×÷±íÖÐ
   sheet.addCell(label);
    // ×ÖÌåÉèÖÃ
    WritableFont font = new WritableFont(WritableFont.createFont("¿¬Ìå_GB2312"), 12, WritableFont.BOLD);
    WritableCellFormat format = new WritableCellFormat(font);
    format.setBackground(jxl.format.Colour.GRAY_25);
    format.setLocked(false);//µ¥Ôª¸ñËø¶¨
    format.setBorder(jxl.format.Border.ALL,
      jxl.format.BorderLineStyle.getStyle(1));
    format.setWrap(true);//ÉèÖÃ×Ô¶¯»»ÐÐ
    // ×ÖÌåÉèÖýáÊø
  // µ¥Ôª¸ñÉèÖÃÄÚÈÝ£¨ÒÔϱíʾ£¬µÚiÁУ¬µÚ1ÐУ©
·½Ê½1£º 
   ExcelUtil.makeCellData(ws, i, 0, (String) map.get("BTF_TITLE"), ExcelUtil.LABEL_ALIGN_LEFT,ExcelUtil.BORDER_LINE_ALL, null, ExcelUtil.CELL_TYPE_LABEL,jxl.format.Colour.GRAY_25);
·½Ê½2£º
     ws.addCell(new Label(i, 0, (String) map.get("BTF_TITLE"), format));
//×îºóдÎļþ£¬¹Ø±Õ
  w.write();
  w.close();
//º


Ïà¹ØÎĵµ£º

javaÈëÃÅ

 Javaѧϰ´ÓÈëÃŵ½¾«Í¨ 
Ò»¡¢ JDK (Java Development Kit) 
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......

javaÖÐsynchronizedÓ÷¨

synchronizedµÄÒ»¸ö¼òµ¥Àý×Ó
public class TextThread
{
 /**
  * @param args
  */
 public static void main(String[] args)
 {
  // TODO ×Ô¶¯Éú³É·½·¨´æ¸ù
        TxtThread tt = new TxtThread();
      ......

java ʼþ»úÖÆ̽ÌÖ

javaÖеÄʼþ»úÖƵIJÎÓëÕßÓÐ3ÖÖ½ÇÉ«£º
1.event object£º¾ÍÊÇʼþ²úÉúʱ¾ßÌåµÄ“ʼþ”£¬ÓÃÓÚlistenerµÄÏàÓ¦µÄ·½·¨Ö®ÖУ¬×÷Ϊ²ÎÊý£¬Ò»°ã´æÔÚÓëlisternerµÄ·½·¨Ö®ÖÐ
2.event source£º¾ßÌåµÄ½ÓÊÜʼþµÄʵÌ壬±ÈÈç˵£¬Äãµã»÷Ò»¸öbutton£¬ÄÇôbutton¾ÍÊÇevent source£¬ÕâÑùÄã±ØÐëʹbutton¶ÔijЩʼþ½øÐÐÏàÓ¦£¬Äã¾ÍÐè ......

Java Àà×°ÈëÆ÷Ô­Àí

 
תÔØ×Ôhttp://blog.csdn.net/yuekun1172006/archive/2007/06/02/1634878.aspx
Àà×°ÈëÆ÷ÊÇ JVM ÓÃÀ´×°ÈëÀàµÄÀ࣬Ëü¶ÔÓÚ Java ±à³ÌÊǷdz£ÖØÒªµÄÒ»¸ö¸ÅÄî¡£Ò»°ãÇé¿öÏ£¬³ÌÐòÔ±ÔÚ±àд³ÌÐòµÄʱºò¶¼¿ÉÒÔºöÂÔÀà×°ÈëÆ÷µÄ´æÔÚÐÔ¡£µ«ÊǶÔÓÚ·þÎñÆ÷¶Ë±à³Ì»òÕßÊÇһЩÌØÊâÇé¿öÏÂʱºò£¬ÉîÈëÁ˽âÀà×°ÈëÆ÷µÄ»úÖÆÒÔ¼°ÆäÔÚ²»Í¬Çé¿öϵ ......

JAVA SQLSERVERÊý¾Ý¿âÁ¬½Ó

 package cn.ctgu.edu.ac;
import java.sql.*;
public class test {
 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  String url="jdbc:sqlserver://localhost:1433;Database=ÍøÉÏÊéµê¹ÜÀíϵͳ;integr ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ