> To change cursor check out
> java.awt.Cursor
> java.awt.Component.setCursor(Cursor)
That would work great, but swing doesn't include a cursor of the
shape that I want.
> Changing cursor wont block GUI from Mouse/Key/Input events.
>
> To block events you should use glass pane.
Actually, I have found glass pane completely inadequate for blocking
events. I intercept the events in the event queue. That works much
better.
Vova Reznik - 30 Sep 2005 15:02 GMT
> Actually, I have found glass pane completely inadequate for blocking
> events. I intercept the events in the event queue. That works much
> better.
Glass Pane is just Component. If you wont add listeners (with empty
methods) to it - it wont block anything, cos it wont know. :)
Something like this:
getGlassPane().addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
// --- EMPTY ---
// --- Nothing to perform ---
}
});
Roedy Green - 01 Oct 2005 02:03 GMT
>Glass Pane is just Component. If you wont add listeners (with empty
>methods) to it - it wont block anything, cos it wont know. :)
Adding an empty listener is the same as having no listener at all.
If you want to suppress events you have to hook in at a lower level
and use event.consume. See http://mindprod.com/jgloss/event11.html
Some years ago I poked around quite a bit in the Java 1.0 and 1.1
event loops. One thing I found distressing was all the cloning of
events. Instead of making them immutable, Java clones them and lets
you ruin them.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Vova Reznik - 03 Oct 2005 15:24 GMT
> Adding an empty listener is the same as having no listener at all.
Not really. If glass pane will not have listeners
then any events will go through glass pane to covered component.
But if glass pane will have listeners - glass pane will consume them all.
Roedy Green - 03 Oct 2005 17:33 GMT
>Not really. If glass pane will not have listeners
>then any events will go through glass pane to covered component.
>But if glass pane will have listeners - glass pane will consume them all.
I did not know that
~ Johnny Carson
I thought GlassPanes were just for doing overlays. I never would have
suspected they would behave like 1.0 events.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Thomas A. Russ - 30 Sep 2005 17:20 GMT
> > To change cursor check out
> > java.awt.Cursor
> > java.awt.Component.setCursor(Cursor)
>
> That would work great, but swing doesn't include a cursor of the
> shape that I want.
There's always java.awt.Toolkit.createCustomCursor

Signature
Thomas A. Russ, USC/Information Sciences Institute