Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么显示的 GUI 具有不同的字体样式/渲染,graphics.drawString()以及带有激活 cleartype 的默认 JLabel?我该如何解决?
graphics.drawString()
尝试这个
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);