textArea.addFocusListener(textAreaFocusListener);
    public void setVisible(boolean visible) {        if (visible) {            initContentPane();            textAreaFocusListener = new FocusAdapter() {                public void focusLost(FocusEvent e) {                    handleFocusOnDispose = false;                    dispose();                }            };            textArea.addFocusListener(textAreaFocusListener);            putFocusOnPopup();            pack();            if (position == null) {                setLocationRelativeTo(view);            } else {                setLocation(position);            }            super.setVisible(true);            Object selectedValue = popupList.getSelectedValue();            popupList.setSelectedIndex(0);            popupList.setSelectedValue(selectedValue, true);            TypeAheadPopupKeyHandler keyHandler = new TypeAheadPopupKeyHandler(this);            addKeyListener(keyHandler);            popupList.addKeyListener(keyHandler);            view.setKeyEventInterceptor(keyHandler);        } else {            super.setVisible(false);        }    }