1.主题统一

This commit is contained in:
JianGuo 2024-06-14 14:01:08 +08:00
parent 52a99a220a
commit 34699ff89d
2 changed files with 5 additions and 3 deletions

View File

@ -28,6 +28,7 @@
<groupId>com.formdev</groupId> <groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId> <artifactId>flatlaf</artifactId>
<version>3.4.1</version> <version>3.4.1</version>
<classifier>no-natives</classifier>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -1,6 +1,6 @@
package com.xiaoliu; package com.xiaoliu;
import com.formdev.flatlaf.FlatDarculaLaf; import com.formdev.flatlaf.themes.FlatMacLightLaf;
import com.xiaoliu.window.MainWindow; import com.xiaoliu.window.MainWindow;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -12,8 +12,9 @@ public class Main {
public static void main(String[] args ){ public static void main(String[] args ){
log.info("服务启动中..."); log.info("服务启动中...");
try { try {
UIManager.setLookAndFeel(new FlatDarculaLaf()); UIManager.setLookAndFeel(new FlatMacLightLaf());
} catch (UnsupportedLookAndFeelException e) { //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
log.error("UnsupportedLookAndFeelException: {}", e.getMessage()); log.error("UnsupportedLookAndFeelException: {}", e.getMessage());
} }
SwingUtilities.invokeLater(() -> new MainWindow().setVisible(true)); SwingUtilities.invokeLater(() -> new MainWindow().setVisible(true));