@Override
        public boolean dispatchKeyEvent(KeyEvent e) {
            if ( e.getID() == KeyEvent.KEY_RELEASED ) {
                boolean happenedOnTextField = e.getComponent() instanceof JTextField;
                boolean happenedOnTextArea = e.getComponent() instanceof JTextArea;

                if ( e.getKeyCode() == KeyEvent.VK_ENTER && happenedOnTextField ) {
                    saveList();
                    close();
                } else if ( e.getKeyCode() == KeyEvent.VK_ESCAPE
                            && (happenedOnTextField || happenedOnTextArea) ) {
                    close();
                }
            }

            return false;
        }