Swing 好看主题
Swing 主题推荐
FlatLaf
,JetBrains 的 IDE 也是用的这个主题,FlatLaf 官网
pox.xml:
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf-intellij-themes</artifactId>
<version>3.0</version>
</dependency>
核心主题:
- FlatLaf Light
com.formdev.flatlaf.FlatLightLaf
- FlatLaf Dark
com.formdev.flatlaf.FlatDarkLaf
- FlatLaf IntelliJ
com.formdev.flatlaf.FlatIntelliJLaf
- FlatLaf Darcula
com.formdev.flatlaf.FlatDarculaLaf
- FlatLaf macOS Light
com.formdev.flatlaf.themes.FlatMacLightLaf
- FlatLaf macOS Dark
com.formdev.flatlaf.themes.FlatMacDarkLaf
使用方法
在项目最开始添加:
public static void main(String[] args) {
// 设置主题
FlatMacLightLaf.setup();
....
}