List of usage examples for java.awt Window requestFocusInWindow
public boolean requestFocusInWindow()
From source file:org.isatools.isacreatorconfigurator.configui.FieldInterface.java
private void showPopupInCenter(Window container) { Container parent = main;//from w w w . j a va 2 s .c om Point parentLocation = parent.getLocationOnScreen(); Dimension parentSize = parent.getSize(); int calcedXLoc = (parentLocation.x) + ((parentSize.width) / 2) - (container.getWidth() / 2); int calcedYLoc = (parentLocation.y) + ((parentSize.height) / 2) - (container.getHeight() / 2); container.setVisible(true); container.setLocation(calcedXLoc, calcedYLoc); container.toFront(); container.requestFocusInWindow(); }