通过Aqua外观禁用JInternalFrames周围的阴影 [英] Disabling the shadow around JInternalFrames with the Aqua Look and Feel

查看:92
本文介绍了通过Aqua外观禁用JInternalFrames周围的阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在具有原生Aqua Look and Feel的Mac OS X上,JInternalFrames的阴影是边框的一部分.当内部框架最大化时,阴影仍然可见并且占用大量空间.

On Mac OS X with the native Aqua Look and Feel, JInternalFrames have a shadow that is part of the frame border. When the internal frame is maximized, the shadow is still visible and takes a lot of space.

有没有一种方法可以在不切换到其他外观的情况下消除阴影?

Is there a way to remove this shadow without switching to another look and feel?

推荐答案

在OpenJDK中研究了Aqua L& F代码后,我发现了一个未记录的属性,可让您更改内部框架的样式.可以使用以下方法去除阴影:

After digging into the Aqua L&F code in OpenJDK I found an undocumented property that let you change the style of an internal frame. Shadows can be removed with this:

internalFrame.putClientProperty("JInternalFrame.frameType", "normal");

http://hg.openjdk.java.net/macosx-port/macosx-port/jdk/file/087d8f180711/src/macosx/classes/com/apple/laf/AquaInternalFrameUI.java

这篇关于通过Aqua外观禁用JInternalFrames周围的阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆