One problem: Java is case sensitive. If is not the same as if (the latter, if, is what you want). Also, there is no JTextField constructor that takes two int parameters. You'll probably want to pass a String and an int instead.

Also, it's cleaner to do

Java Code:

if (!foo)
{
//...

rather than

Java Code:

if (foo == false)
{
//...

Also, you're testing if isDigit is false before you've assigned anything to this variable which doesn't make logical sense.

Don't know how to do this?

rightNumber = 0, and leftNumber =0. That is in my code and also in the textboxes. So it should come up as 0 in the boxes before the user types anything in. Could you please show me how to do that? And BTW, this is not for my homework.
Thanks,
cc11rocks

Could you please show me how to do that? And BTW, this is not for my homework.
Thanks,
cc11rocks

I Recommend you try the suggestions I made. If you still have errors, or specific questions, show them and ask them. And it doesn't matter whether it's homework or not, you are better off coding it yourself. Again, as per your deleted question, please don't ask others to do your coding for you.

What I want

My end goal is to get two text boxes and an enter button in a gui. When you push enter it display the two text box numbers underneath it. When you push certain keys, it does certain things to the numbers. I'm not worried about what the enter button or listeners or anything like that right now. I'm starting simple, then building big. RIGHT NOW on the other hand, i want to display two text boxes. Then, have the numbers 0 in each of them, hence leftNumber and rightNumber. When they type something, I want it to be limited to numbers only. And i want to have the Enter button displayed. That's about it.
Sincerely,
cc11rocks

Before you do I'll just note for posterity that "I want it to be limited to numbers only" means that there is going to be listeners in there somewhere: watching what is typed and vetoing bad input. Those listeners may be obsured (eg made part of a Swing component) but they will be there somewhere.

Also, in case anyone was wondering, it is not enough to assign a value to leftNumber and hope that the runtime was smart enough to display that in smart or whereever. You would have to do something like:

The first argument to the JTextField constructor has to be a String not an int hence the ""+ business. See the API docs. Moreover the variables leftNumber and stupid will not be linked in any way whatsoever.