Some JDK does not contain swing. properties. According to the description in the Java document, if it does not exist, manually add the file to the JRE/lib folder. Add the following content to the file:
# Swing. defaultlaf = javax. Swing. plaf. Metal. metallookandfeel
# Swing. defaultlaf = com. Sun. java. Swing. plaf. motif. motiflookandfeel
# Swing. defaultlaf = com. Sun. java. Swing. plaf. Windows. windowslookandfeel
Swing. defaultlaf = com. Sun. java. Swing. plaf. Windows. windowsclassiclookandfeel
Where # The content following is commented out. If there are two rows without #, the last setting prevails.
Many documents on the webpage are written under the JRE/lib pointed to by java_home. However, after my attempt, if you use the eclipse environment, you need to put the file in Java in help-> Installation Details-> configuration. under JRE/lib in the path described by home. Instead of the JRE/lib under java_home in the system variable. None of the other paths work.
Note: I have tried it only in eclipse. I haven't tried it in other Java development environments. Maybe this file can be stored in jdkxxx/JRE/lib in some development environments. Haha ~~~