开发者

How to dynamically add a new look and feel?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜