Java JOptionPane text unreadable

落花浮王杯 提交于 2019-12-01 23:59:20

问题


Here's a picture of what it ends up looking like.

I don't think it's a problem with the code as it's copied straight from the tutorial website. I've reinstalled JDK, as well as run it in command line and Eclipse. Any possibilities? The code is

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));
    }
}

but I don't think it's an actual code problem, I tested out another sites usage of it and the text still looks like that.


回答1:


Remark: Since the solution has been posted as a comment more than a month ago I'll repeat it as an answer so that the question doesn't show up as unanswered anymore.

Here is the quote from the comment:

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)



来源:https://stackoverflow.com/questions/23715057/java-joptionpane-text-unreadable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!