I have two classes, Game.java
and GameOver.java
.
This part of the code won't work when I launch the program:
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
} catch (Throwable e) {
e.printStackTrace();
}
The Look and Feel won't set the first time, although when the GameOver
class is run and you press retry, the Look and Feel does set. I have tried to track down this issue, but I do not know what is causing it. What is wrong with my code and how do I fix it?