2011-11-09 29 views
1

我有一個與Insubstantial 7.0下的JInternalFrames樣式的問題。我正在使用Eclipse和WindowBuilder for Swing。在Widowbuilder Preview中,放入DesktopPane的JInternalFrames有一個很棒的標題欄(使用GraphiteGlassSkin)。但是當我啓動程序時,所有JInternalFrames的標題欄和客戶端空間只是用相同的灰色繪製,沒有任何區別。如何獲得JInternalFrame標題欄正確樣式由實體

我怎樣才能讓那些標題欄在運行時閃亮?

最好的問候,

大衛

+0

有一些照片嗎? – shemnon

回答

1

上運行時,您可以更改LookAndFeel

1)thenafter你必須調用SwingUtilities.updateComponentTreeUI(Top-Level Container);

2)如果是有一些Backgroung Task你必須將代碼換成invokeAndWait(),如果不是/不存在任何Backgroung Task然後通過使用成功

SwingUtilities.invokeLater(new Runnable() { 

    @Override 
    public void run() { 
     try { 
      UIManager.setLookAndFeel(new GraphiteGlassSkinLookAndFeel()); 
      SwingUtilities.updateComponentTreeUI(frame); 
     } catch (UnsupportedLookAndFeelException e) { 
      throw new RuntimeException(e); 
     } 
    } 
}); 
+0

非常感謝。不幸的是,它不適合我。看起來,titlePane並沒有任何實例化。 – dajood

+0

一些主題改變了例如SubstanceOfficeSilver2007LookAndFeel,如果你下載Substance的代碼源,那麼在java文件夾 - > Check.java是這個世界上Custom Java Look&Feel的最佳指南:-) – mKorbel

+0

downvote,因爲這是一個通用的外觀和感覺答案關於兩個特定工具和外觀和感覺的具體問題。這個答案沒有解決。 – shemnon