 <p>You have a shadowing problem. You declare...</p> <pre><code>private JButton findnext; private JButton replace; private JButton delete; private JButton upper; </code></pre> <p>But in your constructor you do...</p> <pre><code>JButton findnext = new JButton("FindNext"); //... JButton replace = new JButton("Replace"); //... JButton delete = new JButton("Delete"); //... JButton upper = new JButton("Upper"); </code></pre> <p>Which is re-declaring those variables.</p> <p>This means that when you try and do...</p> <pre><code>if (source == findnext) { </code></pre> <p>It's always <code>false</code></p> <p>You're also adding the <code>ActionListener</code> (<code>this</code>) to the <code>findnext</code> button four times...I think you mean to be adding it to each of the other buttons</p> <p>Beware, there is already a class called <code>Window</code> in AWT, which could cause confusion for people. It's also discouraged to extend directly from a top level container like <code>JFrame</code> and instead should start with a <code>JPanel</code> and the add it to an instance of <code>JFrame</code> (or what ever container you like)</p>