Is it possible to remove the little dropdown arrow in a JInternalFrame?

╄→尐↘猪︶ㄣ 提交于 2019-12-01 21:44:48

问题


I'm using a JInternalFrame and I want to remove the dropdown in the upper left of the frame, as it serves no purpose (I've disabled resizeable, closable, etc.)

I don't see a property for this, and I don't want to remove the entire title bar, as the title is necessary. I've looked around online, and basically come up empty here. I'm hoping it's something simple that I've just overlooked, as this is my first time using JInternalFrame, and I'm not exactly a GUI kind of guy to begin with.


回答1:


internalframe.setFrameIcon(null);

Edit: hack to remove system menu in Windows:

BasicInternalFrameUI ui = (BasicInternalFrameUI)internalFrame.getUI();
Container north = (Container)ui.getNorthPane();
north.remove(0);
north.validate();
north.repaint();



回答2:


The relevant Icon in The Synth Look and Feel, among the Nimbus Defaults, appears to have this key:

InternalFrame:InternalFrameTitlePane:"InternalFrameTitlePane.menuButton".icon

You may be able to use the approach shown in A Synth Example to replace the Icon.




回答3:


setFrameIcon(anyBigImageThatCantBeDisplayed);

I´ve tried null parameter and got some visual issues...

So i added a big image(no background) that was already on my resource folder and the icon was no longer displayed as the menu...



来源:https://stackoverflow.com/questions/8144943/is-it-possible-to-remove-the-little-dropdown-arrow-in-a-jinternalframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!