List of usage examples for java.awt FileDialog getSize
public Dimension getSize()
From source file:Main.java
public static void centreDialogOnWindow(Window owner, FileDialog dialog) { Point ownerPosition = owner.getLocationOnScreen(); Dimension ownerSize = owner.getSize(); Dimension dialogSize = dialog.getSize(); int x = ownerPosition.x + (ownerSize.width / 2) - (dialogSize.width / 2); int y = ownerPosition.y + (ownerSize.height / 2) - (dialogSize.height / 2); dialog.setLocation(x, y);/*from ww w .ja va 2 s . co m*/ }