JComponent
スイングアプリでは、を使用して、カスタムでテキストをレンダリングしていますGraphics.drawString()
。ここにサンプルがあります:同じアプリで
テキスト http://img525.imageshack.us/img525/4928/drawstringsample.jpg
を使用してテキストをレンダリングしていJTextPane
ます. ここにサンプルがあります:
代替テキスト http://img28.imageshack.us/img28/1134/jtextpanesample.jpg
下のサンプルが少し「汚れ」ているのがわかりますか? うーん、上のサンプルのように見せる方法がわかりません。
ありがとう、アサフ:-)
アップデート:
System.setProperty("awt.useSystemAAFontSettings","false")
も機能し"lcd"
ていません。((Graphics2D)g).setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF)
で動作しpaint()
ていませんputClientProperty(
sun.swing.SwingUtilities2
.AA_TEXT_PROPERTY_KEY, Boolean.TRUE)
与えるjava.lang.ClassCastException: java.lang.Boolean cannot be cast to sun.swing.SwingUtilities2$AATextInfo