File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how i can make a JinternalFrame un-moveable

 
raminaa niilian
Ranch Hand
Posts: 551
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 824
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic