Java的JOptionPane文本不可读 [英] Java JOptionPane text unreadable

查看:186
本文介绍了Java的JOptionPane文本不可读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我不认为这是代码的问题,因为它直接从教程网站复制。我已经重新安装了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(你几岁?);
int age = Integer.parseInt(input);

System.out.print(Hello,+ name);
System.out.println(明年你会是+(年龄+ 1));




$ b $ p $但是我不认为这是一个实际的代码问题,我测试了它的另一个网站的用法和文本仍然看起来像。

解决方案

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



以下是评论引用:


I FIXED IT!对于那些好奇的人或将来会遇到这个问题的人来说,我进入了我的nvidia控制面板并添加了eclipse,并且覆盖了整合的驱动程序来使用我的nvidia,现在它工作的很好!感谢所有的帮助(user3647851)


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.

解决方案

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)

这篇关于Java的JOptionPane文本不可读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆