aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Immobile JInternalFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Immobile JInternalFrame" Watch "Immobile JInternalFrame" New topic
Author

Immobile JInternalFrame

chinedu efoagui
Ranch Hand

Joined: Feb 11, 2003
Posts: 167
hi does anyone know how to make a JInternalFrame
immovable or immobile.
that is disable the drag making it impossible for someone to drag it
thanks


--One learns a lot during a lesson but seeing is not enough,you must do;knowing is not enough ,you must apply--<br />SCJP 1.4,SCBCD,SCEA part 1,OCM JEE Enterprise Architect.
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

Well, I am pretty sure you could add a JInternalFrameListener and listen for the drag event. Anytime someone drags it, just setLocation(x,y) back where it should go.
However, I think a cleaner approach would be to not use JInternalFrames at all. If you aren't moving the frame around, isn't it just a JPanel? I would use a JPanel in place of a JInternalFrame and just statically place it where you want it.
Either way would work, but I like the JPanel idea better.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

The best way to do this is provide a new DesktopManager to the JDesktopPane that contains this JInternalFrame. Basically, just override the dragFrame() method to ignore moving a frame based on some criteria. In my example I create a marker interface, but you could keep it simple and base it on a predefined title or something if you don't need that much functionality.



-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Immobile JInternalFrame
 
Similar Threads
Newbie at DND
Good to health ?
how to create windows like posit notes?
making things not dragable
Colors applied to JInternalFrames