Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
568 views
in Technique[技术] by (71.8m points)

swing - Java JOptionPane text unreadable

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

enter image description here

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...