ButtonListener setText not working (no errors)

My ButtonListener, when activated (Enter button pressed), is supposed to

Java Code:

stupid.setText("1234")

It does absolutely nothing (the button). The rest of the GUI is working fine.
I am using two files, "Risk.java" and "RiskApp.java". If you tell me what I am doing wrong and how to fix it, that would be great.
Risk.java:

There are no errors when I "java RiskApp". The GUI runs, with two textboxes (with the number 0 in them), text, and an enter button. The numberonly thing works fine. But when I push the enter button, nothing happens.
Thanks for your help,
cc11rocks

Yes.

Works, New Problem

Holy crap! I changed everything to "Enter" with a capital "E". It gave me a bunch of errors. I took out the setText blah blah blah and inserted "System.out.println("Button Pressed"). When I pressed the button, it displayed the text. Now i was wondering about how to set the text in the textbox and NOT have errors.
Thanks,
cc11rocks

Error message

Java Code:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Risk$ButtonListener.actionPerformed(Risk.java:43)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

So that tells you that something in the actionPerformed must be null, something that you're trying to call a method or access a field, and that can only be one variable -- stupid. So check the stupid carefully -- are you sure that you have initialized it? Are you sure that you've initialized the stupid variable that is in the class? That you haven't re-declared it in the constructor (hint, hint)?

That's not declaring a variable. Declaring a variable is when you do this:

Java Code:

JFormattedTextField stupid

How many places do you do this? You should only do it once, in the class itself. If you redeclare it in the constructor than you're creating a new stupid variable in the constructor that is distinct from the class variable and that is only visible in the constructor. Even if you initialize it in the constructor, you're not initializing the important variable, the one declared in the class. This error is so common and so important that it has a name: it's called "shadowing" a variable.

Please edit your post. All your code is left-justified (all lines start in the left column), making your code hard if not impossible to read. I don't think it's asking you too much to make the effort to post well formatted code with standard indentation if you want us to make the effort to help you. Google Java indentation code style will help you learn how to do this. Some hits include:

Sorry I'm dumb, but what does incarnation mean? Does it mean "Is that your final class, the one that caused you errors?"
Thanks and sorry,
Dummy

Is this the latest version of your class? The one where you've tried to correct the problem that I mentioned above -- declaring a variable twice, once in the class and a second time in the constructor? If so, you're still declaring the variable twice! Don't do this: