protected void init() { dialogSizeSettings = new DialogSizeSettings(); buttonPaneVisible = true; confirmAction = new OKAction(); cancelAction = new CancelAction(); setDefaultCloseOperation( DISPOSE_ON_CLOSE ); final JPanel contentPane = new JPanel(); contentPane.setLayout( new BorderLayout() ); buttonPanel = createButtonsPane(); contentPane.add( createContentPane(), BorderLayout.CENTER ); contentPane.add( buttonPanel, BorderLayout.SOUTH ); setContentPane( contentPane ); final InputMap inputMap = contentPane.getInputMap( JComponent.WHEN_IN_FOCUSED_WINDOW ); final ActionMap actionMap = contentPane.getActionMap(); inputMap.put( KeyStroke.getKeyStroke( KeyEvent.VK_ENTER, 0 ), "confirm" ); // NON-NLS inputMap.put( KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0 ), "cancel" ); // NON-NLS actionMap.put( "confirm", getConfirmAction() ); // NON-NLS actionMap.put( "cancel", getCancelAction() ); // NON-NLS resizeDialog(); }