How To Create the Label.
In this we cover way to create a Label and methods of Label class.
Label class is used to create a cell which contains text which may be created by user applications.
Label is subclass of LabelRecord and Label implements WritableCell & LabelCell interfaces.
Label class have following three constructor:-
1.Label(int column, int row, java.lang.String cont):
Create a cell with column and row which contents some text.
Like :-
Label label = new Label(1, 2, "Label 1");
2.Label(int column, int row, java.lang.String cont, CellFormat st):-
Create a cell with column and row which contents some text with cell format.
Like :-
// Create a cell format for Arial 12 point font
WritableFont font = new WritableFont(WritableFont.ARIAL, 12);
WritableCellFormat format = new WritableCellFormat (font);
Label label = new Label(1, 2, " Label 1", format);
3.Label(LabelCell lc):-
This is used when we make copy of a spreadsheet.
Methods Of Label class:-
setString(java.lang.String s):-
Label class has one method [ setString() ]which is used to set the string contents of the cell.