I’m working on the GUI for an RPG maker.
Right now I have a little window that is supposed to pop up on top of what they’re working with and let them make some choices. I’m using a JFrame right now. This of course means I get the nice little box at the bottom of the Windows DeskTop showing it is a frame that’s open and this also means that it has close and minimize buttons whether I like it or not.
I was wanting to have a little moveable component pop up without these problems but that can still be moved over the other work area. I might decide to to go ahead and put a close button on it.
What would the easiest way be to do this?
Thanks,
qb_mon
Use the one build for that task - JDialog.
Yes, I feel like an idiot for not knowing that. I pretty much breezed past it in the book.
I was wondering:
Is there a way to restrict a JDialog so it can only be moved within a JFrame and cannot leave it?
Is there a way to remove the close button in its top right?
Thanks,
qb_mon
If you’re dead set on this window never going beyond its parent’s bounds, you might want to look at JInternalFrame instead.
As far as I can recall, you can disable min/max/close buttons via a method call - check Javadoc.
setUndecorated(true); I think. (can do that with a JFrame too)
You can also make them Look and Feel decorated instead of relying on the system widgets.
[quote]I was wondering:
Is there a way to restrict a JDialog so it can only be moved within a JFrame and cannot leave it?
[/quote]
You can make it modal so the user cannot do anything ni the JFrame until they close it. The only to keep it in the JFrame is use a WindowListener and do bounds checking yourself.
Thanks, that was very helpfull.
-qb_mon