java hssffont_Java HSSFFont.setBoldweight方法代碼示例

本文整理匯總了Java中org.apache.poi.hssf.usermodel.HSSFFont.setBoldweight方法的典型用法代碼示例。如果您正苦於以下問題:Java HSSFFont.setBoldweight方法的具體用法?Java HSSFFont.setBoldweight怎麽用?Java HSSFFont.setBoldweight使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.poi.hssf.usermodel.HSSFFont的用法示例。

在下文中一共展示了HSSFFont.setBoldweight方法的37個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。

示例1: createColumnHeaders

​點讚 3

import org.apache.poi.hssf.usermodel.HSSFFont; //導入方法依賴的package包/類

/**

*/

protected void createColumnHeaders() {

final HSSFRow headersRow = this.sheet.createRow(0);

final HSSFFont font = this.workbook.createFont();

font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

final HSSFCellStyle style = this.workbook.createCellStyle();

style.setFont(font);

style.setAlignment(HSSFCellStyle.ALIGN_CENTER);

int counter = 1;

for (int i = 0; i < this.model.getColumnCount(); i++) {

final HSSFCell cell = headersRow.createCell(counter++);

// cell.setEncoding(HSSFCell.ENCODING_UTF_16);

cell.setCellValue(this.model.getColumnName(i));

cell.setCellStyle(style);

}

}

開發者ID:kiswanij,項目名稱:jk-util,代碼行數:18,

示例2: generateContStyle

​點讚 3

import org.apache.poi.hssf.usermodel.HSSFFont; //導入方法依賴的package包/類

/**

* @Description: 生成excel表格 單元格內容的樣式

* @param workbook

* @return

*

* @History

* 1. 2014-12-19 linwb 創建方法

*/

private HSSFCellStyle generateContStyle(HSSFWorkbook workbook) {

HSSFCellStyle cellStyle = workbook.createCellStyle();

cellStyle.setFillForegroundColor(contCellBackgroundColor);

cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);

cellStyle.setBorderBottom(contBorderBottom);

cellStyle.setBorderLeft(contBorderLeft);

cellStyle.setBorderRight(contBorderRight);

cellStyle.setBorderTop(contBorderTop);

cellStyle.setAlignment(contCellTextAlign);

cellStyle.setVerticalAlignment(contCellVehicleAlign);

// 生成字體

HSSFFont font = workbook.createFont();

font.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);

// 把字體應用到當前的樣式

cellStyle.setFont(font);

return cellStyle;

}

開發者ID:webinglin,項目名稱:excelExportor,代碼行數:29,

示例3: estiloCabecalho

​點讚 3

import org.apache.poi.hssf.usermodel.HSSFFont; //導入方法依賴的package包/類

/**

* Estilo de cabecalho.

* @param wb

* @return retorna o estilo da celula.

* @author Ekler Paulino de Mattos.

*/

private HSSFCellStyle estiloCabecalho(HSSFWorkbook wb){

HSSFCellStyle cellStyle = wb.createCellStyle();

cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THICK);

cellStyle.setBorderRight(HSSFCellStyle.BORDER_THICK);

cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THICK);

cellStyle.setBorderTop(HSSFCellStyle.BORDER_THICK);

cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND );

//cellStyle.setFillForegroundColor(HSSFColor.GREY_40_PERCENT.index);

cellStyle.setFillForegroundColor(HSSFColor.LIGHT_YELLOW.index);

cellStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);

HSSFFont font = cellStyle.getFont(wb);

font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

font.setColor(HSSFFont.COLOR_NORMAL);

font.setFontName(HSSFFont.FONT_ARIAL);

cellStyle.setFont(font);

return cellStyle;

}

開發者ID:darciopacifico,項目名稱:omr,代碼行數:30,

示例4: estiloDadosConsultado

​點讚 3

import org.apache.poi.hssf.usermodel.HSSFFont; //導入方法依賴的package包/類

/**

* Estilo dos campos dos dados.

* @param wb

* @return retorna o estilo da celula.

* @author Ekler Paulino de Mattos.

*/

private HSSFCellStyle estiloDadosConsultado(HSSFWorkbook wb){

HSSFCellStyle cellStyle = wb.createCellStyle();

cellStyle.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM);

cellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);

cellStyle.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);

cellStyle.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);

// plano de fundo - para que funcione deve se

// definido antes um padrao de preenchimento.

cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND );

//cellStyle.setFillForegroundColor(HSSFColor.AQUA.index);

cellStyle.setFillForegroundColor(HSSFColor.WHITE.index);

cellStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);

HSSFFont font = cellStyle.getFont(wb);

font.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);

font.setColor(HSSFFont.COLOR_NORMAL);

font.setFontName(HSSFFont.FONT_ARIAL);

cellStyle.setFont(font);

return cellStyle;

}

開發者ID:darciopacifico,項目名稱:omr,代碼行數:32,

示例5: estiloDadosRetorno

​點讚 3

import org.apache.poi.hssf.usermodel.HSSFFont; //導入方法依賴的package包/類

/**

* Estilo dos campos dos dados.

* @param wb

* @return retorna o estilo da celula.

* @author Ekler Paulino de Mattos.

*/

private HSSFCellStyle estiloDadosRetorno(HSSFWorkbook wb){

HSSFCellStyle cellStyle = wb.createCellStyle();

cellStyle.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM);

cellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);

cellStyle.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);

cellStyle.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);

// plano de fundo - para que funcione deve se

// definido antes um padrao de preenchimento.

cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND );

//cellStyle.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index);

cellStyle.setFillForegroundColor(HSSFColor.PALE_BLUE.index);

cellStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);

HSSFFont font = cellStyle.getFont(wb);

font.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);

font.setColor(HSSFFont.COLOR_NORMAL);

font.setFontName(HSSFFont.FONT_ARIAL);

cellStyle.setFont(font);

return cellStyle;

}

開發者ID:darciopacifico,項目名稱:omr,代碼行數:32,

示例6: estiloCabecalho

​點讚 3

import org.apache.poi.hssf.usermodel.HSSFFont; //導入方法依賴的package包/類

/**

* Estilo de cabecalho.

* @param wb

* @return retorna o estilo da celula.

* @author Ekler Paulino de Mattos.

*/

private HSSFCellStyle estiloCabecalho(HSSFWorkbook wb){

if(this.estiloCabecalho==null){

this.estiloCabecalho = wb.createCellStyle();

this.estiloCabecalho.setBorderBottom(HSSFCellStyle.BORDER_THIN);

this.estiloCabecalho.setBorderRight(HSSFCellStyle.BORDER_THIN);

this.estiloCabecalho.setBorderLeft(HSSFCellStyle.BORDER_THIN);

this.estiloCabecalho.setBorderTop(HSSFCellStyle.BORDER_THIN);

this.estiloCabecalho.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND );

//cellStyle.setFillForegroundColor(HSSFColor.GREY_40_PERCENT.index);

this.estiloCabecalho.setFillForegroundColor(HSSFColor.LIGHT_YELLOW.index);

this.estiloCabecalho.setAlignment(HSSFCellStyle.ALIGN_LEFT);

HSSFFont font = this.estiloCabecalho.getFont(wb);

font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

font.setColor(HSSFFont.COLOR_NORMAL);

font.setFontName(HSSFFont.FONT_ARIAL);

this.estiloCabecalho.setFont(font);

}

return this.estiloCabecalho;

}

開發者ID:darciopacifico,項目名稱:omr,代碼行數:32,

示例7: writeCaption

​點讚 3

import org.apache.poi.hssf.usermodel.HSSFFont; //導入方法依賴的package包/類

/**

* @see org.displaytag.render.TableWriterTemplate#writeCaption(org.displaytag.model.TableModel)

*/

@Override

protected void writeCaption(TableModel model) throws Exception

{

HSSFCellStyle style = this.wb.createCellStyle();

HSSFFont bold = this.wb.createFont();

bold.setBoldweight(Font.BOLDWEIGHT_BOLD);

bold.setFontHeightInPoints((short) 14);

style.setFont(bold);

style.setAlignment(CellStyle.ALIGN_CENTER);

this.colNum = 0;

this.currentRow = this.sheet.createRow(this.sheetRowNum++);

this.currentCell = this.currentRow.createCell(this.colNum);

this.currentCell.setCellStyle(style);

String caption = model.getCaption();

this.currentCell.setCellValue(new HSSFRichTextString(caption));

this.rowSpanTable(model);

}

開發者ID:webbfontaine,項目名稱:displaytag,代碼行數:22,

示例8: initStili

​點讚 3

import org.apache.poi.hssf.usermodel.HSSFFont; //導入方法依賴的package包/類

/**

* ereditare questo metodo per modificare gli stili utilizzati

*/

protected void initStili()

{

HSSFFont fontGrassetto = _workBook.createFont();

fontGrassetto.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

fontGrassetto.setFontHeightInPoints((short) 10);

HSSFFont fontTesto = _workBook.createFont();

fontTesto.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL );

fontTesto.setFontHeightInPoints((short) 10);

_styleIntestazioni = _workBook.createCellStyle();

_styleIntestazioni.setFont(fontGrassetto);

_styleIntestazioni.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);

_styleIntestazioni.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);

_styleIntestazioni.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM);

_styleIntestazioni.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);

_styleIntestazioni.setAlignment(HSSFCellStyle.ALIGN_CENTER);

_styleIntestazioni.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);

_styleTesto = _workBook.createCellStyle();

_styleTesto.setFont(fontTesto);

}

開發者ID:giasap0,項目名稱:konga,代碼行數:26,

示例9: setHeaderStyle

​點讚 3

import org.apache.poi.hssf.usermodel.HSSFFont; //導入方法依賴的package包/類

private void setHeaderStyle(HSSFWorkbook wb) {

HSSFCellStyle style =

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值