package color;
import java.io.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
public class pro {
public static void main(String[] args) {
pro test=new pro();
}
pro(){
String file;
file="ren.xls";
try{
FileInputStream is = new FileInputStream(file);
Workbook wb = new HSSFWorkbook(is);
Sheet sh = wb.getSheetAt(0);
int s,sx;
s=2;
sx=1;
Row row = sh.getRow(s);
Cell cc = row.getCell(sx);
if(cc == null)cc = row.createCell(1);
CellStyle p=cc.getCellStyle();
short col=p.getFillBackgroundColor();
String c=String.valueOf(col);
System.out.println(s+","+sx+","+c);
} catch (Exception e) {e.printStackTrace();}
}
}
最終更新:2014年01月23日 03:15