> How does one enable a component that is using a Glasspane work on
> applications that use AWT or should i don't bother about awt at all?
What do you mean by "enable"?
You should not mix AWT components with Swing components.

Signature
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Common User Interface Services
M/S 2R-94 (206)544-5225
#! rnews 1354
Xref: xyzzy comp.lang.java.gui:128141
Newsgroups: comp.lang.java.gui
Path: xyzzy!nntp
From: "Fred L. Kleinschmidt" <fred.l.kleinschmidt@nospam_boeing.com>
Subject: Re: Using a cursor variable as a flag
X-Nntp-Posting-Host: xpc-ps-53.nw.nos.boeing.com
Content-Type: text/plain; charset=us-ascii
Message-ID: <428DFD59.E58CEFAC@nospam_boeing.com>
Sender: nntp@news.boeing.com (Boeing NNTP News Access)
Content-Transfer-Encoding: 7bit
Organization: Boeing
X-Accept-Language: en
References: <428db9a6$1@news.starhub.net.sg>
Mime-Version: 1.0
Date: Fri, 20 May 2005 15:08:09 GMT
X-Mailer: Mozilla 4.79 [en]C-CCK-MCD Boeing Kit (Windows NT 5.0; U)
> Presently, on mousePressed on a component, I set the Cursor to
> MOVE_CURSOR. In another unrelated method, I check whether the Cursor is
> MOVE_CURSOR before processing something. Is it okay to do that way
> taking into account that other methods might chance the cursor in
> different threads or should i use a boolean flag?
If the cursor type is supposed to mean something to the user, and if a
different thread can change the cursor before that functionality is
performed, then your program logic is broken. Your user is going to
become very confused.

Signature
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Common User Interface Services
M/S 2R-94 (206)544-5225
I'm not sure I understand your question... but here is some basic
information about glass panes.
Glass panes are invisible windows that can be activated to block
keyboard and mouse input to the underlying frame with which they are
associated.
Glass panes are available with a few of the classes in the javax.swing
package. These include: JRootPane, JFrame, and JInternalFrame.
If you can use and have access to the javax.swing package from your
app, you can make use of glass panes by using one of the aformentioned
classes.
To learn more about glass panes, check here:
http://java.sun.com/docs/books/tutorial/uiswing/components/rootpane.html
- Mike
- - 21 May 2005 01:21 GMT
> I'm not sure I understand your question... but here is some basic
> information about glass panes.
[quoted text clipped - 14 lines]
>
> - Mike
Yup, but what if another application uses an AWT top level window that
does not support glasspane? The application will throw an error when
xxx.getGlassPane() is called, right? Hence, should there be an
alternative way to make it work for both AWT and Swing or should I just
forget about AWT compatibility?
mkrause - 23 May 2005 17:46 GMT
Are you planning on using reflection here? Otherwise, you'll find out
at compile time that you can't get a glass pane.
Since glass panes are a swing concept, you'll need to use swing. To
have something work for AWT-only applications, you'd have to roll your
own version.
- Mike