aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
Author

how i can make a JinternalFrame un-moveable

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 550
Hi
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.

Thanks
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
internalFrame.setMaximum(true);

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: http://aspose.com/file-tools
 
subject: how i can make a JinternalFrame un-moveable
 
Similar Threads
Using JInternalFrame and JDesktop
Windows opened from menu items move down and to the right
Do we have a JStatusBar in java?
MouseEvent handling.
Multiple JFrames in 1 Container