The code that goes between these actionListener braces depends on what you want to happen.
For a start, you would want to display the digit into your display.
Is your display panel p1?
You could then, for instance, put in te code:
But you see that you run into trouble here.
First of all, you do not have a dedicated textfield for your display.
Secondly, the pressed digit button might not be the first digit button pressed,
for instance, say you want to input the number '89'. Then first the '8' is pressed,
and then the '9' is pressed. So, in fact you would have to add the '9' to what's already there.
As it is now, you must give thought to what you want to do with your program.
What would you want to do when the user presses the '=' button? Then some
expression that the user has input must be evaluated.
But for now, I would concentrate on getting these digits on your display panel.
Joined: Mar 07, 2014
the code that you gave comes up with errors and i can't seem to fix them