Java JOptionPane 文本不可读

标签 java swing text fonts windows-8.1

这是它最终的样子的图片。

enter image description here

我不认为代码有问题,因为它是直接从教程网站复制的。我已经重新安装了 JDK,并在命令行和 Eclipse 中运行它。有什么可能吗?代码是

import javax.swing.*;

public class Swag {

    public static void main ( String[] args) {
        String name = JOptionPane.showInputDialog("What is your name?");

        String input = JOptionPane.showInputDialog("How old are you?");
        int age = Integer.parseInt(input);

        System.out.print(" Hello, " +name);
        System.out.println("Next year you'll be " +(age+1));
    }
}

但我不认为这是一个实际的代码问题,我测试了另一个网站的使用情况,文本看起来仍然是那样。

最佳答案

备注: 由于解决方案已在一个多月前作为评论发布,因此我将重复它作为答案,这样问题就不会再显示为未回答。

引用自评论:

I FIXED IT! For those who are curious or people in the future that will have this problem, I went into my nvidia control panel and added eclipse to it, and overrode the integrated driver to use my nvidia, and now it works fine! Thanks for all the help (user3647851)

关于Java JOptionPane 文本不可读,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23715057/

相关文章:

java - @Before 不会在 java Cucumber Step 中执行

java - 如何在 Java GUI 中显示一行?

java - 将 JButton 文本设置为左对齐?

android:微调器的每个项目都有不同的颜色

Python-删除文本文件中的最后一个字符

Java - 在 Swing 中加入多个绘图字符串

java - JavaFX GUI 是否对性能影响很大?

java - 如何清除Chrome web driver和IE web driver的日志

java - Animate ball JPanel subclass is not abstract错误

java - 将字符串编码为 UTF-8 和 7 位编码