JAVA技巧:poi操作excel
包裝*。*;
導入Java . util . ArrayList;
導入Java . util . iterator;
導入org . Apache . poi . hssf . user model . hssf cell;
導入org . Apache . poi . hssf . user model . hssfcellstyle;
導入org . Apache . poi . hssf . user model . hssf font;
導入org . Apache . poi . hssf . user model . HSS flow;
導入org . Apache . poi . hssf . user model . hssf sheet;
導入org . Apache . poi . hssf . user model . hssf workbook;
public class font cellstyle {
private static hssf font font style = null;
private static HSSFCellStyle cellStyle = null;
public static hssf font gethdrfont(hssf workbook WB){
font style = WB . create font();
fontStyle.setFontName("微軟雅黑");
font style . setfontheightinpoints((short)20);
font style . setboldwight(hssf font。BOLD weight _ BOLD);
返廻fontStyle
}
public static hssf font getFtrFont(hssf workbook WB){
font style = WB . create font();
fontStyle.setFontName("微軟雅黑");
font style . setfontheightinpoints((short)12);
font style . setboldwight(hssf font。bold weight _ NORMAL);
返廻fontStyle
}
public static hssf font getcontent font(hssf workbook WB){
font style = WB . create font();
fontStyle.setFontName("微軟雅黑");
font style . setfontheightinpoints((short)12);
font style . setboldwight(hssf font。bold weight _ NORMAL);
返廻fontStyle
}
0條評論