File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes how i can make a JinternalFrame un-moveable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how i can make a JinternalFrame un-moveable" Watch "how i can make a JinternalFrame un-moveable" New topic

how i can make a JinternalFrame un-moveable

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Thank you for reading my post
How i can prevent users from moving a JInternalFrame in an JDesktop component ?
I have several Internal frame inside a Jdesktop and i want some of them to be fixed in regard to their location.

Sunil Kumar Gupta
Ranch Hand

Joined: Aug 26, 2005
Posts: 824
One solution is to remove the listener which is responsible for moving the InternalFrame

for(MouseListener listener : ((javax.swing.plaf.basic.BasicInternalFrameUI) this.internalFrame.getUI()).getNorthPane().getMouseListeners()){
((javax.swing.plaf.basic.BasicInternalFrameUI) this.internalFrame.getUI()).getNorthPane().removeMouseListener(listener);

or add the InternalFrame in a splitpane and set

This will give a nonmovable InternalFrame

Lack of will power has caused more failure than lack of intelligence or ability.
My Blog | Red5 Resources | Technology Update | Daily Technology Tips
I agree. Here's the link:
subject: how i can make a JinternalFrame un-moveable
It's not a secret anymore!