-1
package abc;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFBorderFormatting;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import java.util.Iterator;
public class read {
public static void main(String[] args) throws IOException {
String Filepath = "C:\\test.xls";
FileInputStream input = new FileInputStream("Filepath");
HSSFWorkbook wb = new HSSFWorkbook(); //Access the workbook
//Access the worksheet, so that we can update/modify it.
HSSFSheet worksheet = wb.getSheetAt(0);
Cell cell = null; // declare a Cell object
cell = worksheet.getRow(2).getCell(2);
CellStyle style = wb.createCellStyle();
style.setFillForegroundColor(IndexedColors.BLUE.getIndex());
cell.setCellStyle(style);
try {
FileOutputStream output = new FileOutputStream(
"C:\\Users\\TEMP\\Desktop\\downloads.xls"
);
wb.write(output);
output.close();
} catch(Exception e){
e.printStackTrace();
}
}
}
ここでは判読可能ですが、何が問題なのか説明してください –