I run this java code
import javax.swing.JOptionPane;
public class Dialog1{
public static void main(String[] args){
JOptionPane.showMessageDialog(null, "Welcome to Java");
}
}
I get this
Then I say I want to set nimbus as the default look and feel for all java applications that run on my computer. So I write this code on a text editor and save the file as swing.properties
swing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel
I copy that file on C:\Program Files\Java\jdk-17\lib like this
When I run the code of class Dialog1 above I still get the same look and feel
I mean I thought I should get a nimbus look and feel, cause I did everything right or at least I think so. I wonder where I was wrong, someone please help. I use java version "17.0.10"
Some sites say lib
or bin
but it only worked for me with conf
folder. Copy your new settings file to {jdk-17-home}\conf\swing.properties
.