});
dialog.addWindowFocusListener(new WindowFocusListener() {
public void windowGainedFocus(WindowEvent e) {
ContentUI content = (ContentUI) contentManager.getContent(dialog.getContentPane().getComponent(0));
content.fireSelected(true);
}
public void windowLostFocus(WindowEvent e) {
if (dialog.getContentPane().getComponentCount() > 0) {
ContentUI content = (ContentUI) contentManager.getContent(dialog.getContentPane().getComponent(0));