• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please rescue me out

 
jide agboola
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to build a simple calculator with three textFields, for data X and Y to yield result Z on the third TextField, with five Buttons for each arithmetic operator and clear button.

This is my code


i have only added Listerner to the add button.
i dont know i still keep getting errors.
Thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
remove everything unrelated to the construction of the gui
e.g.
x.getText(dataX);
all the listener code

now you can concentrate on getting the gui to display.
when it diaplays OK, then add the listeners/functionality
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic