Re: Need help with a gui program

What happened when you tried that?

-----

Consider using more descriptive variables and methods than jTextField1 and jButton1ActionPerformed(). As the amount of code increases there is a very real payoff from having variables and methods say, by their very text, what they are and do.

Re: Need help with a gui program

If you walk through your code in your head, you'll see that the output you see is what you should expect. Do you know that the + operator has different meanings if you're dealing with Strings vs. numbers, and your method above uses it for both situations, numeric addition and String concatenation.