6
6
import jxl .Cell ;
7
7
import jxl .Sheet ;
8
8
import jxl .Workbook ;
9
-
9
+ import jxl .biff .FontRecord ;
10
+ import jxl .biff .drawing .ComboBox ;
11
+ import jxl .format .Alignment ;
12
+ import jxl .format .Border ;
13
+ import jxl .format .BorderLineStyle ;
14
+ import jxl .format .CellFormat ;
15
+ import jxl .format .Colour ;
16
+ import jxl .format .Font ;
17
+ import jxl .format .Format ;
18
+ import jxl .format .Orientation ;
19
+ import jxl .format .Pattern ;
20
+ import jxl .format .VerticalAlignment ;
10
21
import jxl .read .biff .BiffException ;
11
-
12
22
import jxl .write .Label ;
13
23
import jxl .write .Number ;
24
+ import jxl .write .WritableCellFeatures ;
14
25
import jxl .write .WritableSheet ;
15
26
import jxl .write .WritableWorkbook ;
16
27
import jxl .write .WriteException ;
@@ -27,19 +38,25 @@ public static void main(String[] args) throws BiffException, IOException,
27
38
WritableWorkbook wworkbook = Workbook .createWorkbook (new File (
28
39
"output.xls" ));
29
40
WritableSheet wsheet = wworkbook .createSheet ("First Sheet" , 0 );
30
- Label label = new Label (0 , 2 , "A label record" );
41
+ Label label = new Label (0 , 1 , "A label record" );
42
+ label .setCellFeatures (new WritableCellFeatures ());
43
+ label .getWritableCellFeatures ().setComment ("Test comment" );
44
+ label .getWritableCellFeatures ().setComboBox (new ComboBox ());
31
45
wsheet .addCell (label );
46
+ wsheet .addCell (new Label (3 ,1 , "PI" ));
32
47
Number number = new Number (3 , 4 , 3.1459 );
33
48
wsheet .addCell (number );
34
49
wworkbook .write ();
35
50
wworkbook .close ();
36
51
37
52
Workbook workbook = Workbook .getWorkbook (new File ("output.xls" ));
38
53
Sheet sheet = workbook .getSheet (0 );
39
- Cell cell1 = sheet .getCell (0 , 2 );
54
+ Cell cell1 = sheet .getCell (0 , 1 );
40
55
System .out .println (cell1 .getContents ());
41
- Cell cell2 = sheet .getCell (3 , 4 );
56
+ Cell cell2 = sheet .getCell (3 ,1 );
57
+ Cell cell3 = sheet .getCell (3 , 4 );
42
58
System .out .println (cell2 .getContents ());
59
+ System .out .println (cell3 .getContents ());
43
60
workbook .close ();
44
61
}
45
62
}
0 commit comments