Modal JWindow

Is there a simple way of setting a JWindow to be MODAL?Thx again!
[79 byte] By [yanngreniera] at [2007-11-26 20:37:38]
# 1
use JDialog
hellbindera at 2007-7-10 1:54:02 > top of Java-index,Desktop,Core GUI APIs...
# 2
i can't use JDialog. I need my popup to be partly transparent and you can't do this with JDialog.So i REALLY need to use a JWindow and simulate the modal property of a JDialog...
yanngreniera at 2007-7-10 1:54:02 > top of Java-index,Desktop,Core GUI APIs...
# 3

> i can't use JDialog. I need my popup to be partly transparent and you can't do this with JDialog.

Why?

What's the difference between JDialog and JWindow transparency wise?

Use JDialog.setUndecorated(true) before displaying the dialog to disable the dialog decorations.

Rodney_McKaya at 2007-7-10 1:54:03 > top of Java-index,Desktop,Core GUI APIs...
# 4
I do not wish to remove the TitleBorder (which is what setUndecorated() does), i wish to see through my window.
yanngreniera at 2007-7-10 1:54:03 > top of Java-index,Desktop,Core GUI APIs...
# 5
And can you do this using JWindow and not JDialog?What method are you using?
Rodney_McKaya at 2007-7-10 1:54:03 > top of Java-index,Desktop,Core GUI APIs...
# 6

You might be able to use Glasspane to block all the other windows. Its a round-about way of doing things, I would make sure that you can't get JDialog to do what you want first.

If you call getGlassPane()

on you Frame / JFrame / JWindow / whatever, you will get the GlassPane object associated with that frame, and set it to visible. This should block user interactions with the frame underneath. Of course, calling this method on all the necessary windows will be tricky.

e.g. frame.getGlassPane().setVisible(true);

This article explains root panes etc.:

http://java.sun.com/docs/books/tutorial/uiswing/components/rootpane.html

Hope that helps.

James

http://jamesjavablog.blogspot.com/

jallena at 2007-7-10 1:54:03 > top of Java-index,Desktop,Core GUI APIs...
# 7

> If you call getGlassPane()

on you Frame

> / JFrame / JWindow / whatever, you will get the

> GlassPane object associated with that frame, and set

> it to visible. This should block user interactions

Sure. But you could make the frame even harder to interact with just by saying setEnabled(false)

tjacobs01a at 2007-7-10 1:54:03 > top of Java-index,Desktop,Core GUI APIs...
# 8

> i wish to see through my window.

You can't, which was explained in your last posting on this topic:

http://forum.java.sun.com/thread.jspa?threadID=5144306

So learn to respond to your original posting and quit wasting everybodies time by creating new posting. Keep the conversation in one place.

camickra at 2007-7-10 1:54:03 > top of Java-index,Desktop,Core GUI APIs...