JLabel-是否可以设置RenderingHints.VALUE_TEXT_ANTIALIAS_OFF? [英] JLabel - is it possible to set RenderingHints.VALUE_TEXT_ANTIALIAS_OFF?

查看:76
本文介绍了JLabel-是否可以设置RenderingHints.VALUE_TEXT_ANTIALIAS_OFF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在JLabel中关闭ANTIALIAS?像这样的东西(但是它不起作用..):

Is it possible to turn off ANTIALIAS in JLabel? Something like this (but it is not working..):

@Override
    public void paintComponent(Graphics g) {

        Graphics2D graphics2d = (Graphics2D) g;
        graphics2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
        super.paintComponent(g);
    }
}

还是应该创建可轻松设置此ANTIALIAS值的自定义标签?目的是使文本不模糊.

Or should I create custom Label where I can easily set this ANTIALIAS value? The goal is to make the text not fuzzy.

推荐答案

找到了解决方案(应用程序启动时的第一行):

Found the solution (first lines when application starts):

System.setProperty("awt.useSystemAAFontSettings", "off");
System.setProperty("swing.aatext", "false");

现在一切正常,我可以在Eizo ColorEdge显示屏上看到漂亮的字体.我的问题-为什么Windows OS还会使用所有这些模糊/模糊设置...并且几乎不可能关闭抗锯齿..尝试在Windows 10桌面底部的任务栏中执行此操作....噩梦.很难相信有人可以使用它并说没关系" :)我相信竞争对手会来的:)

Now everything is OK, I can see nice fonts on my Eizo ColorEdge display. My question - why the hell Windows OS uses all that blurred/fuzzy settings also... And almost impossible to switch off antialiasing.. Try to do that in Windows10 taskbar at the Desktop bottom.... Nightmare. It is hard to believe that someone could use it and say "it's OK" :) I believe the rivals are coming :)

这篇关于JLabel-是否可以设置RenderingHints.VALUE_TEXT_ANTIALIAS_OFF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆