简体   繁体   English

JInternalFrame裁剪了Windows上的外观

[英]JInternalFrame cropped Look and feel on windows

I'm currently working on a stand-alone java application running on Windows 7 with Aero. 我目前正在研究在带有Aero的Windows 7上运行的独立Java应用程序。

I'm trying to use the system look and feel but I got some trouble with the look of the JInternalFrame . 我正在尝试使用系统外观,但是JInternalFrame的外观有些麻烦。

http://img11.hostingpics.net/pics/300466buginternalframe.png http://img11.hostingpics.net/pics/300466buginternalframe.png

This is a screenshot of the internalFrame demo from Oracle 这是OracleinternalFrame演示的屏幕截图

As you can see, I use the system look-and-feel, but the lower border is cropped and the title buttons are too close of the right side of the window. 如您所见,我使用系统的外观,但是下边框被裁剪,标题按钮离窗口右侧太近。 Those also seems to be a bit cropped. 那些似乎也被裁剪了。

I search for a fix to those issues but the only advice I found is to reduce the buttons width by changing the UIManager properties: 我正在寻找解决这些问题的方法,但是我发现的唯一建议是通过更改UIManager属性来减小按钮的宽度:

 UIManager.put("InternalFrame.titleButtonWidth", 10);

This line do reduce the buttons but they still seems to be cropped. 这条线确实减少了按钮,但它们似乎仍被裁剪。 And it does not fix the lower border issue. 而且它不能解决下边界问题。

How could I possibly fix these 2 issues using the system look-and-feel? 如何使用系统外观来解决这两个问题?

The only way I found to bypass this bug is to change the internalFrame close icon for a custom icon in the UIManger which is a bit smaller than the original close icon: 我发现绕过此错误的唯一方法是更改​​UIManger中自定义图标的internalFrame关闭图标,该图标比原始关闭图标小:

ImageIcon closeIcon = new ImageIcon(ImageIO.read(new File(iconPath)))
UIManager.put("InternalFrame.closeIcon", closeIcon);    

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM