}
private OverlayDecorator buildOverlay() {
JComponent content = BorderLayoutBuilder.fillWith(pwdUi);
content.setBorder(Empty.border(10, 10, 0, 10));
OverlayDecorator overlay = new OverlayDecorator(content, null) {
@Override
protected void onCancel() {
dispose(null);
}
@Override
protected void onOk() {
if (pwdUi.validate()) {
char[] pwd = pwdUi.getPassword();
dispose(pwd);
} else {
redisplay();
}
}
};
overlay.useOkAndCancel();
overlay.setBlocking(true);
overlay.setFadeIn(AnimationPreference.get());
overlay.setFocusReceiverWhenClosed(focusReceiverWhenClosed);
return overlay;
}