Getting java applications to look native on windows - how?

前端 未结 8 2288
悲哀的现实
悲哀的现实 2021-02-08 03:13

Is it possible to use Java to create apps that look native on Windows? I don\'t care if the solution is portable or not, because I only plan to target windows users. I am using

8条回答
  •  醉话见心
    2021-02-08 03:35

    You have to use Windows look and feel.

    You can specify it at the command line:

    java -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel MyApp
    

    Or in code

    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    

    Here are the details: How to set the look and feel

提交回复
热议问题