 <p>Your program <em>does</em> have a visible error, precisely where it's failing:</p> <pre><code>optionlist.addActionListener((ActionListener) this); </code></pre> <p><code>this</code> is a reference to an instance of <code>hello</code>. The <code>hello</code> class doesn't implement <code>ActionListener</code> - so how would you expect that cast to succeed?</p> <p>The only implementation of <code>ActionListener</code> you've given is <code>OptionButtonHandler</code>. Perhaps you meant:</p> <pre><code>optionlist.addActionListener(new OptionButtonHandler()); </code></pre> <p>?</p>