java jframe窗口颜色,是否可以更改JFrame或JInternalFrame的标题栏颜色

I am trying to change title bar color.but it dosen't work

UIManager.put("JFrame.activeCaption", new javax.swing.plaf.ColorUIResource( Color.GREEN));

JFrame.setDefaultLookAndFeelDecorated(true);

解决方案

I do not think that you can do anything about the colors in the title bar of a JFrame, at least not without using native code to implement a platform-specific solution. That is because JFrame actually uses your native windowing system to create the window.

As for internal frames, it would make sense for you to be able to customize it, since it is a component rendered inside of a window that is controlled by Java. Indeed, there are plenty of JInternalFrame properties that you can set in your UI manager. However, I wasn't able to get those to work on my system.

Doing a little googling, it appears that others have found that you cannot change the appearance of JInternalFrame without changing your whole system's look and feel settings. So, I'm afraid that you might have to depend on the operating system to control the colors of your title bars even when using internal frames.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值