This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I have three textfields and a button in the window. I want the program to store whatever user types in each textfields , in three separate strings , WHEN the user clicks the button. Can anyone please give teh code for just the handler class or the actionPerformed() method. or if you don't wanna type in the code, please explain the syntax that would allow me to do it.
I'm stuck with this problem and really need help as soon as possible. Thank you, I appreciate it.
Michael Dunn wrote:> 2) Here is what I do when I have only one textField...
have you tested that by printing out the value of 'str'?
not in console, but yes I was able to and I did print it out in GUI.
I'm assuming getActionCommand() gets the input (when user hits enter). My question is, how do I do that simultaneously for more than one textfields
Joined: Jun 09, 2003
post a working example of that code
the user's input to the textfield, and I'll
add two textfields and the necessary
adjustments to your handler code, so
it'll do what you want.
your code only needs to be small:
just mske sure it compiles/runs/outputs ok