P
Peter Ashford
Hi there,
I have a jframe with a mouse listener on it. I use mouse events to
allow the user to drag the frame around the screen. This all works
fine, but I added some code to set a tooltip for the frame on the
mouse entered method like so:
public void mouseEntered(MouseEvent e){
Date now = new Date();
String toolTipTxt = String.format("%tA %te %tB %tY", now,
now, now, now);
frame.getRootPane().setToolTipText(toolTipTxt);
frame.setCursor(moveCursor);
}
....and this seems to end up consuming all of the mouse events, so that
I now cannot move my frame (nor launch the popup menu attached to it
via a rightclick action)
Is this correct behaviour? If so, how should one add a tooltip to a
frame with a mouselistener on it?
Thanks!
I'm using Java 1.6.
I have a jframe with a mouse listener on it. I use mouse events to
allow the user to drag the frame around the screen. This all works
fine, but I added some code to set a tooltip for the frame on the
mouse entered method like so:
public void mouseEntered(MouseEvent e){
Date now = new Date();
String toolTipTxt = String.format("%tA %te %tB %tY", now,
now, now, now);
frame.getRootPane().setToolTipText(toolTipTxt);
frame.setCursor(moveCursor);
}
....and this seems to end up consuming all of the mouse events, so that
I now cannot move my frame (nor launch the popup menu attached to it
via a rightclick action)
Is this correct behaviour? If so, how should one add a tooltip to a
frame with a mouselistener on it?
Thanks!
I'm using Java 1.6.