model.setCaseSensitive(source.isSelected());
finder.setCaseSensitive(source.isSelected());
    private void initComponents()    {        createMenuBar();        createLeftMenuBar();        caseSensitive = new JCheckBox("Match case");        caseSensitive.addChangeListener(new ChangeListener() {            public void stateChanged(ChangeEvent e) {                JCheckBox source = (JCheckBox) e.getSource();                model.setCaseSensitive(source.isSelected());            }        });        infoComponent = new JPanel();        findArea = new JTextField();        findArea.setBorder(BorderFactory.createBevelBorder(                			BevelBorder.LOWERED));        findArea.setBackground(Color.WHITE);        findArea.setOpaque(true);        findArea.setEditable(true);        int h = getFontMetrics(getFont()).getHeight()+4;        findArea.setPreferredSize(new Dimension(WIDTH, h));        findArea.addKeyListener(new KeyAdapter() {            /** Finds the phrase. */            public void keyPressed(KeyEvent e)            {                if ((e.getKeyCode() == KeyEvent.VK_ENTER)) {                    Object source = e.getSource();                    if (source instanceof JTextField) {                        JTextField field = (JTextField) source;                        if (field.getText() != null &&                                 field.getText().length() > 0)                            finder.find();                    }                }            }        });        findArea.getDocument().addDocumentListener(new DocumentListener() {                        /**             * Sets the finder's controls enabled if no phrase entered.             * @see DocumentListener#removeUpdate(DocumentEvent)             */            public void insertUpdate(DocumentEvent de)            {                Document d = de.getDocument();                try {                    finder.setTextUpdate(d.getText(0, d.getLength()));                } catch (Exception e) {}            }            /**             * Sets the finder's controls enabled if no phrase entered.             * @see DocumentListener#removeUpdate(DocumentEvent)             */            public void removeUpdate(DocumentEvent de)            {                 Document d = de.getDocument();                try {                    finder.setTextUpdate(d.getText(0, d.getLength()));                } catch (Exception e) {}            }            /**              * Required by I/F but no-op implementation in our case.              * @see DocumentListener#changedUpdate(DocumentEvent)             */            public void changedUpdate(DocumentEvent de) {}                    });    }