JOptionPane not displaying correctly?

安稳与你 提交于 2019-11-28 12:34:44
trashgod

For reference, here's a complete example that shows no regression on Mac OS X 10.9, Java 8. It may help you pin down the apparent regression.

Addendum: In helpful comments, @mKorbel cites a number of similar problems with Java 8 on Windows with certain NVIDIA cards.

Console:

42

Code:

import java.awt.EventQueue;
import javax.swing.JOptionPane;

/**
 * @see https://stackoverflow.com/a/24875960/230513
 */
public class Test {

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                String input = JOptionPane.showInputDialog(
                    "Enter the x coordinate of the circle");
                int xc = Integer.parseInt(input);
                System.out.println(xc);
            }
        });
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!