Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我从头开始制作了一个 JComponent 子组件,并为它制作了基于基本和金属的外观和感觉。即使我为整个应用程序使用金属主题,我仍然必须在对象上调用 setUI 以使其成为金属。如果它可用并且默认为基本,有什么方法可以使用当前的 LnF?
您可以覆盖并安装updateUI()您JComponent想要的任何自定义设置:
updateUI()
JComponent
@Override public void updateUI() { super.updateUI(); // customize here }