Reputation: 311
How to remove or hide the left side Drop Down Menu only on jinternal frame Title Bar and not to remove or hide whole Title Bar.
How to set not Move jinternal frame by mouse holding in jdesktop pane.
Check below snapshot for better understand my question what I want:
http://i49.tinypic.com/1zfned2.jpg
Upvotes: 0
Views: 1669
Reputation: 311
1. how to remove or hide the left side Drop Down Menu only on jinternal frame Title Bar and not to remove or hide whole Title Bar. source code:
BasicInternalFrameUI ui = (BasicInternalFrameUI)internalFrame.getUI();
Container north = (Container)ui.getNorthPane();
north.remove(0);
north.validate();
north.repaint();
2. how to set not Move jinternal frame by mouse holding in jdesktop pane. source code:
for(MouseListener listener : ((javax.swing.plaf.basic.BasicInternalFrameUI) internalFrame.getUI()).getNorthPane().getMouseListeners()){
((javax.swing.plaf.basic.BasicInternalFrameUI) internalFrame.getUI()).getNorthPane().removeMouseListener(listener);
}
Thanks
Upvotes: 0
Reputation: 691635
As far as I know, the only way is to use your own UI delegate for the internal frame. See http://today.java.net/pub/a/today/2007/02/22/how-to-write-custom-swing-component.html for an article explaining how UI delegates work.
Since you seem to use the Synth look n' feel, you should be able to easily create your own subclass of SynthInternalFrameUI
, that would override the createNorthPane()
method in order to create and return an instance of a custom subclass of SynthInternalFrameTitlePane
.
This custom title pane would in turn override the addSubComponents()
method in order to not add the menuButton
. I've not tested all that, so maybe you'll need to override additional methods.
Upvotes: 1