This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Applets and the fly likes getText() is not working? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "getText() is not working?" Watch "getText() is not working?" New topic

getText() is not working?

munjal upadhyay
Ranch Hand

Joined: Sep 18, 2010
Posts: 69

the problem is written in the comments

Paul Clapham

Joined: Oct 14, 2005
Posts: 18114

Yes, that code is working correctly.

In your actionPerformed method you create a new Desine object. Naturally all of its instance variables are created and initialized as per lines 7 to 35 of your posted code. In particular the JTextFields are empty. So when you access the contents of one of those JTextFields you get an empty string.

I assume you are surprised that you don't get the data from the JTextField from the original Desine object, the one which would be referred to as "this" in the actionPerformed method. You shouldn't be surprised, because you didn't ask for the data from that object.
munjal upadhyay
Ranch Hand

Joined: Sep 18, 2010
Posts: 69

I got it ....

I agree. Here's the link:
subject: getText() is not working?
Similar Threads
Can't Update Record ?
Getting a problem while using database connectivity
Adding Record Problem in JDBC ?
Getting sql error [Microsoft ][odbc microsoft access driver]numeric index out of range
Can't Update Record ?