Let's say that the code snippet (we don't have the
entire code) is implementing the actionLister, then
you have to have a method called actionPerformed,
let's say that it's the one that throws the
nullPointerException (if it is) then add to that line
"throws nullPointerException", then put your code in
the try braces in the catch-try statement, then you
will run the program without problems. Check the SDK
for the exact syntax. A nullPointerException is, just
my guess, the most common "error" in Java, probably
because of you don't access pointers the way you do in
C and C++.