I started a Java Swing repl and copied some code from a textbook, but it doesn't work! I keep getting this error: 'Display not Capable of DPMS.' If it doesn't mean anything, what should I do?? The console just outputs 'Hello World' and the applet doesn't show anything.
Here is the link to my code: https://repl.it/@SangeetS/SimpleUI (under SalutonFrame.java)
The issue is that repl.it runs the code from the
Main.java file and it only has the code to print
Hello World to the console. If you need to run some piece of code, you need to make sure it's in the main file and not in some other file. Of course you can import from other files into the main file but the
main function of the
Main.java file will be executed. Not the main function of some other file.