final double goldenRatio = 1.61803399; dialog.setSize( DIALOG_WIDTH, (int) Math.round(DIALOG_WIDTH / goldenRatio));