It's not a secret anymore!
The moose likes Swing / AWT / SWT and the fly likes ComponentMoved Event ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "ComponentMoved Event ??" Watch "ComponentMoved Event ??" New topic

ComponentMoved Event ??

Scott Presley

Joined: Apr 15, 2003
Posts: 25
Here is the situation, I have a grid of textfields within a panel. This panel is contained within a scrollpane. The focused textfield in this grid has a floating window attached to it, something similar to a tooltip, but with a lot more functionality. When I need it, I pop up this special tooltip-window relative to the textfield that it is attached to.

The problem I'm having is that when I scroll the grid using the scrollpanel, the textfield moves, but the special tooltip-window stay put. The tooltip-window is registered as a component listener of the textfield to which it is associated.

Here is the thing: According to the �How to Write a Component Listener� section of the Java Tutorial, componentMoved is only called �after the listened-to component moves, relative to its container.� Since I'm using the scrollpane, the textfield never moves relative to it's container...

does anyone know how I could capture the event that that the textfield moves? I know that I could listen to the scrollpane itself, but that wouldn't work when I move the entire frame...

Thanks in advance,
It is sorta covered in the JavaRanch Style Guide.
subject: ComponentMoved Event ??
jQuery in Action, 3rd edition