混合外观 [英] Mixing look and feel
本文介绍了混合外观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
到目前为止,我有这个
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
UIManager.getBorder("design");//change look and feel here?
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Nimbus isn't available");
}
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
design GUI = new design();
GUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GUI.setVisible(true);
}
});
}
我正在尝试使主外观看起来像雨云,但是将标题边框更改为Windows.
I'm trying to make the main look and feel nimbus, but change the titled border to windows.
我的边界是这个
contentPanel.setBorder(new TitledBorder("Downloader"));
有可能吗?如果是的话,有人可以指出我在哪里看?我现在很困惑. :\
Is it possible to do? If it is can someone point me where to look? I'm so confused right now. :\
谢谢.
推荐答案
我已经完成了.您必须创建UI的各个部分,然后调用UIManager.setLookAndFeel()来更改外观.感受,然后创建其他部分.更像是黑客.
I've done it. You have to create parts of the UI, and then call UIManager.setLookAndFeel() to change the look & feel, and then create the other parts. It's more like a hack.
这篇关于混合外观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文