/** * Positions the specified frame in the middle of the screen. * * @param frame the frame to be centered on the screen. */ public static void centerFrameOnScreen( final Window frame ) { positionFrameOnScreen( frame, 0.5, 0.5 ); }
/** * Positions the specified frame at a random location on the screen while ensuring that the entire frame is visible * (provided that the frame is smaller than the screen). * * @param frame the frame. */ public static void positionFrameRandomly( final Window frame ) { //noinspection UnsecureRandomNumberGeneration positionFrameOnScreen( frame, Math.random(), Math.random() ); }
final Container parent = dialog.getParent(); if ( parent == null || ( parent.isVisible() == false ) ) { positionFrameOnScreen( dialog, horizontalPercent, verticalPercent ); return;