一、仿IntelliJ Darcula的Swing主题FlatLaf使用方法
<dependencies>
<!-- https://mvnrepository.com/artifact/com.formdev/flatlaf -->
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId>
<version>0.26</version>
</dependency>
</dependencies>
用法1:
//Light主题
//FlatLightLaf.install();
//Darcula主题
FlatDarculaLaf.install();
JFrame frame=new JFrame();
用法2:
try {
UIManager.setLookAndFeel( new FlatLightLaf() );
} catch( Exception ex ) {
System.err.println( "Failed to initialize LaF" );
}
二、jtattoo 皮肤包
<dependency>
<groupId>com.jtattoo</groupId>
<artifactId>JTattoo</artifactId>
<version>1.6.13</version>
</dependency>
用法:
//在Main函数里添加:
JFrame.setDefaultLookAndFeelDecorated(true);
UIManager.setLookAndFeel("com.jtattoo.plaf.hifi.HiFiLookAndFeel");