The Artima Developer Community
Sponsored Link

Java Answers Forum
How to make an internal frame unmovable?

1 reply on 1 page. Most recent reply: Mar 12, 2006 1:52 PM by bug not

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Melvin

Posts: 6
Nickname: melvin
Registered: Jan, 2003

How to make an internal frame unmovable? Posted: Feb 18, 2003 5:33 PM
Reply to this message Reply
Advertisement
Hi,

I have a problem here which I hope someone can help me out.

I have a JInternalFrame object and I want to use it to display some data updates to the user. So how can I make the frame unmovable so that user could not move the frame to anywhere else on the screen.

If anyone know the answer then pls reply to this mail as soon as possible. Thank you.


bug not

Posts: 41
Nickname: bugmenot
Registered: Jul, 2004

Re: How to make an internal frame unmovable? Posted: Mar 12, 2006 1:52 PM
Reply to this message Reply
The cleanest way to achieve that is to just ... remove the listeners which make the frame move :

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

simple, clean, efficient :)

Flat View: This topic has 1 reply on 1 page
Topic: dice roller Previous Topic   Next Topic Topic: Understanding Thread

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use