Swing JFrame.setDefaultLookAndFeelDecorated与UIManager.setLookAndFeel

问题描述 投票:0回答:1

在Swing中,似乎有两种方法可以设置应用程序的主题/外观:

  • JFrame.setDefaultLookAndFeelDecorated
  • UIManager.setLookAndFeel

我想知道这些之间的区别以及何时/为什么使用它们中的任何一个。

java swing user-interface theming
1个回答
0
投票
UIManager.setLookAndFeel(...)(和其他相关的UIManager方法)允许设置应用程序的外观。

JFrame.setDefaultLookAndFeelDecorated(...)仅会影响新创建的JFrame的窗口装饰方式(即窗口标题栏,关闭/最小化按钮等)。通常,它不会影响应用程序的外观。

© www.soinside.com 2019 - 2024. All rights reserved.