@Override public void windowActivated(WindowEvent e) { getInitFocusedComponent().requestFocus(); } });
/** * Call three createXxxPanel methods and layout them using BorderLayout. By default, banner panel, content panel and * button panel are added to NORTH, CENTER and SOUTH of BorderLayout respectively. * <p/> * You can override this method if you want to layout them in another way. */ protected void initComponents() { getContentPane().setLayout(new BorderLayout()); _standardDialogPane.initComponents(); getContentPane().add(_standardDialogPane); if (getInitFocusedComponent() != null) { addWindowListener(new WindowAdapter() { @Override public void windowActivated(WindowEvent e) { getInitFocusedComponent().requestFocus(); } }); } }