这是一张它最终看起来像什么的图片.
我不认为这是代码的问题,因为它是直接从教程网站复制的.我重新安装了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)