Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JXL API - Excel cell font size setting problem

807603Oct 24 2007
Hi,

Please help me in the following problem:
I have a cell which content is e.g " Car (red) " . I want to set the
font size for "Car" to 10 and the font size for "(red)" to 8 within the same cell
However I can set the font size of the whole cell content but can't set
different font sizes for its substrings.
I use the following code for setting the font size:
...
WritableCell cell = null;
		Label lbl = null;
		cell = wsheet.getWritableCell(col,row);
		WritableFont wf = new WritableFont(WritableFont.ARIAL,10);
		WritableCellFormat wcf = new WritableCellFormat(wf);
		lbl = new Label(col,row,cell.getContents(),wcf);
...
wsheet.addCell(lbl);
...
Tried to find a method for appending a Label content but didn't find anything.
CopyTo didn't work either. Is there any solution to this?

Thanks in advance,
o9ip
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2007
Added on Oct 24 2007
0 comments
312 views