summaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorAndrew C. Oliver <acoliver@apache.org>2002-08-15 14:13:34 +0000
committerAndrew C. Oliver <acoliver@apache.org>2002-08-15 14:13:34 +0000
commitb25e15e3d74362485c265b9b24632503e195f54a (patch)
tree7222262a4404813a70171cec81ce27aacb87e4e8 /src/examples
parent0ea73358ae8b7f166ab020b9e9e851844a4e22a5 (diff)
downloadpoi-b25e15e3d74362485c265b9b24632503e195f54a.tar.gz
poi-b25e15e3d74362485c265b9b24632503e195f54a.zip
custom data formats patch: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11068
PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352825 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java2
-rw-r--r--src/examples/src/org/apache/poi/hssf/usermodel/examples/CreateDateCells.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java
index d6bd14c6b0..2513631c28 100644
--- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java
+++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java
@@ -109,7 +109,7 @@ public class BigExample
//set cell stlye
cs.setFont(f);
//set the cell format see HSSFDataFromat for a full list
- cs.setDataFormat(HSSFDataFormat.getFormat("($#,##0_);[Red]($#,##0)"));
+ cs.setDataFormat(HSSFDataFormat.getBuiltinFormat("($#,##0_);[Red]($#,##0)"));
//set a thin border
cs2.setBorderBottom(cs2.BORDER_THIN);
diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/CreateDateCells.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/CreateDateCells.java
index c7b230a2bf..073e8fcf60 100644
--- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/CreateDateCells.java
+++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/CreateDateCells.java
@@ -85,7 +85,7 @@ public class CreateDateCells
// we style the second cell as a date (and time). It is important to create a new cell style from the workbook
// otherwise you can end up modifying the built in style and effecting not only this cell but other cells.
HSSFCellStyle cellStyle = wb.createCellStyle();
- cellStyle.setDataFormat(HSSFDataFormat.getFormat("m/d/yy h:mm"));
+ cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy h:mm"));
cell = row.createCell((short)1);
cell.setCellValue(new Date());
cell.setCellStyle(cellStyle);