1

セル内のテキストの一部をある色 (フォントの色) に設定し、他の部分を別の色に設定したいと思います。これは jxl api で可能ですか? それとも制限ですか?

例:

セルに「名前*」があり、「名前」の色を青、「*」の色を赤にしたい。

前もって感謝します。

4

2 に答える 2

2

はい、できます。次のコードを確認してください。

     WritableFont TableFormat = new WritableFont(WritableFont.ARIAL, 8, WritableFont.BOLD,false, UnderlineStyle.NO_UNDERLINE, Colour.WHITE);
     WritableCellFormat tableFormatBackground = new WritableCellFormat(); //table cell format
     tableFormatBackground.setBackground(Colour.DARK_BLUE) ; //Table background
     tableFormatBackground.setBorder(Border.ALL, BorderLineStyle.THIN,Colour.BLACK); //table border style
     tableFormatBackground.setFont(TableFormat); //set the font
     tableFormatBackground.setAlignment(Alignment.CENTRE);// set alignment left
于 2011-11-02T14:44:46.027 に答える