My shortcuts are blurry in Java

I am writing a small font application in JLabels designed to be displayed on large, low resolution screens.

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

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

      

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

enter image description here

Here are the images that are zoomed in and reprogrammed again so you don't need to zoom in to see my problem.

enter image description here

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

+1


source to share


1 answer


I don’t know since you didn’t provide any code, but if you have anti-aliasing enabled it may cause the text to appear like this:

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

      



Try to remove them (if they exist) or set them to "off" and "false" respectively.

+1


source







All Articles