Here is a link to the project I am working on: http://goo.gl/myzeQQ It works fine when I run it in Netbeans on my desktop(java 8) but gives me this error when I run it at the link above. It looks like the error might be due to the online compiler not being compatible with the JFrame graphics in some way.
答案 0 :(得分:3)
It's because your code is running in a headless environment (no GUI) yet you are creating and using a GUI.
It works fine on your computer because you have a GUI and everything required to display those graphical components.
You can fix/prevent this by creating a program that runs in the terminal and only accepts text input, or installing some sort of virtual gui on the machine that runs it.