开发者

Why different font rendering with graphics.drawString() and a default JLabel with ClearType?

Why has the displayed GUI different font style/rendering with graphics.drawString() and a default JLabel with activated cleartype? And how can i fix it?

开发者_开发百科

Why different font rendering with graphics.drawString() and a default JLabel with ClearType?


Try this

Graphics2D g2d = (Graphics2D)g;    
Font font = new Font("Arial", Font.PLAIN, 12);

g2d.setFont(font);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawString("Hello World", 25, 100);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜