我的标签在 Java 中很模糊 [英] My labels are blurry in Java

查看:20
本文介绍了我的标签在 Java 中很模糊的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 JLabels 编写一个小字体的应用程序,旨在显示在大的低分辨率屏幕上.

I am writing an application with small fonts in JLabels meant to be displayed on large low res screens.

我使用此代码创建了一个 JLablel,JFrame 具有白色背景.

I create a JLablel using this code, the JFrame has white background.

JLabel myJlabel=new JLabel();
myJlabel.setFont(new Font("Terminal",0,8));
myJlabel.setForeground(Color.black);
myJlabel.setText("Hamburger");

但是看起来很模糊.形象打击说明了我的问题.左边它来自我的应用程序的屏幕截图,右边它来自具有相同字体和大小的 Notapad.exe.一个如果模糊,则不是.

But it looks blurry. The image blow illustrates my problem. On the left it is from a screenshot of my application and on the right it is from the Notapad.exe with the same font and size. One if blurry and on is not.

这是再次放大和重新屏幕截图的图像,因此您无需放大即可看到我的问题.

Here is the images again enlarged and re-screen shot so you won't need to zoom to see my problem.

我需要 Java 中的标签和右边的一样清晰.有没有办法让 JLabels 不模糊?

I need the labels in Java to be just as sharp as on the right. Is there a way to make JLabels not blurry?

推荐答案

我不知道,因为您还没有提供任何代码,但是如果您启用了抗锯齿,则可能会导致文本显示为它是:

I don't know, as you haven't provided any code, but if you have anti-aliasing enabled, that can cause the text to be displayed like it is:

    System.setProperty("awt.useSystemAAFontSettings","on"); 
    System.setProperty("swing.aatext", "true");

尝试删除这些(如果存在),或将它们分别设置为关闭"和假".

Try removing these (if they exist), or setting them to "off" and "false" respectively.

这篇关于我的标签在 Java 中很模糊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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