问题
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