List of usage examples for javax.swing SwingUtilities getLocalBounds
public static Rectangle getLocalBounds(Component aComponent)
From source file:org.eclipse.jubula.rc.swing.driver.RobotAwtImpl.java
/** * Ensures that the passed component is visible. * @param component The component.//from ww w . j a v a 2 s . c o m * @param bounds Optional bounds inside the component. If not <code>null</code>, the bounds are scrolled to visible. * @throws RobotException If the component's screen location cannot be calculated. */ private void ensureComponentVisible(final Component component, final Rectangle bounds) throws RobotException { m_queuer.invokeAndWait("ensureVisible", new IRunnable() { //$NON-NLS-1$ public Object run() { Rectangle rectangle = bounds != null ? new Rectangle(bounds) : SwingUtilities.getLocalBounds(component); if (log.isDebugEnabled()) { log.debug("Scrolling rectangle to visible: " + rectangle); //$NON-NLS-1$ } Scroller scroller = new Scroller(component); scroller.scrollRectToVisible(rectangle); return null; } }); }