Posted By:
Almagest_FUTT
Posted On:
Wednesday, May 18, 2005 12:12 AM
Hi.
first, of course, getGlassPane().setVisible(true) (set it visible(false) when you're finished).
be glassPane the GlassPane.
be panel your panel.
Add a MouseListener to glassPane (i don't think you'll ever need to remove it), in each of which's methods you do something like that:
void checkEvent(MouseEvent e){
Point p = e.getPoint();
p = SwingUtilities.convertPoint(glassPane, p.x, p.y, panel);
if( panel.contains(p) ){
Component target = SwingUtilities.getDeepestComponentAt(panel, p.x, p.y);
if(target!=null){ //be safe
MouseEvent newEvent = SwingUtilities.convertMouseEvent(glassPane, e, target);
glassPane.getToolkit().getSystemEventQueue.postEvent(newEvent);
}
e.consume(); // <- important
}
That should do it.