易截截图软件、单文件、免安装、纯绿色、仅160KB

(例)Java生成PDF报表 iText

// 导入IO库类
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
// 导入 POI库类
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
// 导入 iText库类
import com.lowagie.text.BadElementException;
import com.lowagie.text.Cell;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.PageSize;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Table;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfWriter;
public class PrintStudent {
 /**
  * @param args
  * @throws IOException
  * @throws DocumentException
  */
 public static void main(String[] args) throws DocumentException,
   IOException {
  // 定义页面
  PageSize Pg = new PageSize();
  // 生成PDF文档实例
  Document document = new Document(Pg.A4);
  // 载入中文字库
  BaseFont bfChinese = BaseFont.createFont("STSong-Light",
    "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
  try {
   // 输入文档实例
   PdfWriter.getInstance(document,
     new FileOutputStream("Chap0101.pdf"));
   document.open();
   /*
    * 生成表头 读取文档 350.XLS
    */
   WillsRecor Re = new WillsRecor("350.xls");
   // 定义第一页的数据列表.
   ArrayList ReL;
   // 读取一页
   ReL = Re.Next();
   // 如果读取列表中有数据,则生成一页内容.
   while (!ReL.isEmpty()) {
    // 定义页头
    Paragraph Title = new Paragraph();
  &n


相关文档:

JAVA常用操作语句 项目中的总结四


 eclipse选一个变量后,这个类里的该变量不变色问题解决:
alt + shift + o

/**
* 写入日志
* filePath 日志文件的路径
* code 要写入日志文件的内容

*/

public

static

boolean
print(String filePath,String code) {

try
{
File tofile
=
new
File(filePath);
......

Java 调用EXE

使用Runtime.getRuntime().exec()方法可以在java程序里运行外部程序.  
  该方法有6个可访问版本:  
  1.exec(String   command)  
  2.exec(String   command,   String   envp[],   File   dir)    
  3.exec(String   cmd, &n ......

C/C++与Java函数重载区别!

#include <iostream>
using namespace std;
class Base {
public:
virtual void fn(int x) {
cout << "In Base class, int x = " << x << endl;
}
};
class SubClass : public Base {
public:
// 函数的重载,这样的重载方式,在Java中能行,在C/C++中却不行
virt ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号