Ask coding questions

← Back to all posts
Display Not Capable of DPMS Java Swing
SangeetS (1)

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)

Answered by TheDrone7 (652) [earned 5 cycles]
View Answer
Commentshotnewtop
TheDrone7 (652)

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.

SangeetS (1)

@TheDrone7 However, when I run it, the JFrame is supposed to have the title be "All me." It doesn't do that. Please advise.

TheDrone7 (652)

@SangeetS as far as I can see, it does have that title.

SangeetS (1)

@TheDrone7 there recently was a notification that said that 'there is a new version of repl.it. Click here to reload' and that made it work. THANKS for everything!

SangeetS (1)

I declare this question ANSWERED