如何对出力到excel的字符进行游对齐? 从数据库中读出的字段有数字和字符,字符默认为左对齐,数字默认为右对齐。如何将字符设为右对齐?谢谢!在线等! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 HSSFFont font = wb.createFont();// create a cell style object HSSFCellStyle cellStyleLeft = wb.createCellStyle(); cellStyleLeft.setAlignment(HSSFCellStyle.ALIGN_LEFT); cellStyleLeft.setVerticalAlignment(MIDDLE); cellStyleLeft.setBorderBottom(HSSFCellStyle.BORDER_THIN); cellStyleLeft.setBorderLeft(HSSFCellStyle.BORDER_THIN); cellStyleLeft.setBorderTop(HSSFCellStyle.BORDER_THIN); cellStyleLeft.setBorderRight(HSSFCellStyle.BORDER_THIN); cellStyleLeft.setFillForegroundColor(WHITE); cellStyleLeft.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); cellStyleLeft.setFont(font);// create a cell style object HSSFCellStyle cellStyleRight = wb.createCellStyle(); cellStyleRight.setAlignment(HSSFCellStyle.ALIGN_RIGHT); cellStyleRight.setVerticalAlignment(MIDDLE); cellStyleRight.setBorderBottom(HSSFCellStyle.BORDER_THIN); cellStyleRight.setBorderLeft(HSSFCellStyle.BORDER_THIN); cellStyleRight.setBorderTop(HSSFCellStyle.BORDER_THIN); cellStyleRight.setBorderRight(HSSFCellStyle.BORDER_THIN); cellStyleRight.setFillForegroundColor(WHITE); cellStyleRight.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); cellStyleRight.setFont(font);createCell( row, (short) j, cellStyleRight, plist.get(j)); 求大家指出这里的不足 怎样读取TextField中的换行符到文本文档中 (char)30的输出显示问题 三元运算符输出结果问题 一个问题. jdk1.2 请问大家我想知道目前我所编写的.java文件的包路径和名称,请问如何实现,谢谢 一个jtable的实时监控的超难度问题,分不够可以再增加 Tomcat中如何配置路径 这个程序为什么x与y的值不相等? String类的内存使用问题: JDBC连接mySQL数据库问题,,在线等 马上结贴
HSSFFont font = wb.createFont();
// create a cell style object
HSSFCellStyle cellStyleLeft = wb.createCellStyle();
cellStyleLeft.setAlignment(HSSFCellStyle.ALIGN_LEFT);
cellStyleLeft.setVerticalAlignment(MIDDLE);
cellStyleLeft.setBorderBottom(HSSFCellStyle.BORDER_THIN);
cellStyleLeft.setBorderLeft(HSSFCellStyle.BORDER_THIN);
cellStyleLeft.setBorderTop(HSSFCellStyle.BORDER_THIN);
cellStyleLeft.setBorderRight(HSSFCellStyle.BORDER_THIN);
cellStyleLeft.setFillForegroundColor(WHITE);
cellStyleLeft.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
cellStyleLeft.setFont(font);
// create a cell style object
HSSFCellStyle cellStyleRight = wb.createCellStyle();
cellStyleRight.setAlignment(HSSFCellStyle.ALIGN_RIGHT);
cellStyleRight.setVerticalAlignment(MIDDLE);
cellStyleRight.setBorderBottom(HSSFCellStyle.BORDER_THIN);
cellStyleRight.setBorderLeft(HSSFCellStyle.BORDER_THIN);
cellStyleRight.setBorderTop(HSSFCellStyle.BORDER_THIN);
cellStyleRight.setBorderRight(HSSFCellStyle.BORDER_THIN);
cellStyleRight.setFillForegroundColor(WHITE);
cellStyleRight.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
cellStyleRight.setFont(font);createCell( row, (short) j, cellStyleRight, plist.get(j));