2017-02-25 50 views
-1

我能够改变的JInternalFrame的标题栏的字体,但我无法改变的JInternalFrame的前景......我尝试使用下面的代码,但凭着努力无法更改Jinternal框架的标题前景

UIManager.put("InternalFrame.activeTitleBackground", Color.red); 
UIManager.put("InternalFrame.activeTitleForeground", Color.blue); 
UIManager.put("InternalFrame.inactiveTitleBackground", Color.black); 
UIManager.put("InternalFrame.inactiveTitleForeground", Color.yellow); 

回答

0

这些值由Basic LAF使用。

但是,您的LAF可能会扩展基本的LAF以使用不同的值进行绘画。

结帐UIManager Default。此类显示每个组件的默认值。

查看“系统颜色”项目。你“可能”很幸运,并找到一些你可以覆盖的值。

但是,确定颜色的实际逻辑可以在类似MetalInternalFrameTitlePaneWindowsInternalFrameTitlePane的类中找到。因此,您需要查看实际的源代码以查看发生了什么。坦率地说,逻辑对我来说太困难了,也许你会有更好的运气。