开发者

How to dynamically add a new look and feel?

开发者 https://www.devze.com 2023-01-18 06:33 出处:网络
I开发者_JAVA百科 want to make sure that the user himself could add L & F. But how to do this I do not understand.

I开发者_JAVA百科 want to make sure that the user himself could add L & F. But how to do this I do not understand. it is even possible?


The important thing is to update all components shown in the frame

UIManager.setLookAndFeel(lnfName);
SwingUtilities.updateComponentTreeUI(frame);
frame.pack();


If I got your question right then it is pretty straight forward really. Have a look at http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html. There is even a demo app that lets you change the L&F on the fly.

The important class doing most of the work is UIManager.

0

精彩评论

暂无评论...
验证码 换一张
取 消