The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

WindowBuilder - beginner problem.

Please move the thread if there is a forum that is better suited.

I have a basic understanding of Java. However, GUI's are far out of my reportoire. I have a GUI with three textfields and a button. I want the user to enter two integers, one in each textfield, and press the button. The sum of the numbers will appear in the third textfield. I have no idea where to begin,

Re: WindowBuilder - beginner problem.

The text fields hold Strings. To do arithmetic with a String, convert it to a numeric data type by using a method in the Integer or Double class. Do the arithmetic and then convert the result to a String using a method in the String class and put that into the textfield.
See the API doc for each of the classes being used for the methods:Java Platform SE 7

Re: WindowBuilder - beginner problem.

Originally Posted by Norm

The text fields hold Strings. To do arithmetic with a String, convert it to a numeric data type by using a method in the Integer or Double class. Do the arithmetic and then convert the result to a String using a method in the String class and put that into the textfield.
See the API doc for each of the classes being used for the methods:Java Platform SE 7

I don't follow. How do I convert from Text to String, as Text is a new class? How do I make the program understand that it's not going to handle the textfield itself, but the string inside it?