import com.jxcell.CellFormat; import com.jxcell.TextWithFormat; import com.jxcell.View; import com.jxcell.designer.Designer; import java.awt.*; public class TextFormattingTest { public static void main(String args[]) { View m_view = new View(); try { //set data m_view.setText(0,0,"Hello, you are welcome!"); m_view.setColWidth(0, 36*256); m_view.setRowHeight(0, 120*20); //text orientation CellFormat rangeStyle = m_view.getCellFormat(); rangeStyle.setOrientation((short)45); m_view.setCellFormat(rangeStyle); //multi text selection format TextWithFormat[] tf = new TextWithFormat[4]; tf[0] = new TextWithFormat(m_view); tf[1] = new TextWithFormat(m_view); tf[2] = new TextWithFormat(m_view); tf[3] = new TextWithFormat(m_view); tf[0].setFontItalic(true); tf[0].setStartPos(0); tf[0].setFontColor(Color.BLUE.getRGB()); tf[1].setFontBold(true); tf[1].setFontSize(16*20); tf[1].setStartPos(7); tf[2].setFontUnderline(true); tf[2].setStartPos(11); tf[2].setFontColor(Color.GREEN.getRGB()); tf[3].setFontSize(14*20); tf[3].setStartPos(14); m_view.setTextFormat(tf); m_view.write("./TextFormatting.xls", View.eFileExcel); Designer.newDesigner(m_view); } catch (Exception e) { e.printStackTrace(); } } }