|
|
#1 |
|
\m/
(Forum King) |
Java help
I wrote a class for an input dialog for a word game assignment. It uses a password field so that the other player can't guess the sercret word as the first player types it in. However, my actionPerformed method in this class always throws an exception. Specifically, the getPassword() method does. I don't understand what I'm doing wrong. Any ideas?
code: this is how I call it. I'm not sure if this is correct either. . . code: word is a String instance variable of the class for the game UI. THanks in advance //this was supposed to be in GD. oops. [edit > JonnyMac] Now, it is in GD [/edit]
Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. |
|
|
|
|
|
#2 |
![]() Join Date: Jun 2000
Posts: 60,839
|
Damn, you're quick JM. I didn't even get a chance to reply to his PM before it was moved. :P
|
|
|
|
|
|
#3 |
|
\m/
(Forum King) |
Hey JM! nice to see you. how's tech support holding up? I really wish I could help out in there as much as I used to, but I've been really busy with college lately.
Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Dec 2000
Posts: 14,385
|
Hi sarge
I was looking in Who's Online and saw k_rock posting a new thread in TS.k_rock posting a new thread in TS??? I It must be a case of temporary insanity. ![]() Hi k_rock WATS, has been ok lately and I have been taking it easy over there. No probs. I appreciate the help, but understand the need to devote more time to college. Good luck. |
|
|
|
|
|
#5 |
|
Forum King
Join Date: Jan 2002
Location: the nether reaches of bonnie scotland
Posts: 13,375
|
What's the exception it throws?
|
|
|
|
|
|
#6 |
|
\m/
(Forum King) |
a NullPointer
however, it works when i do the following in the actionPerformed JPasswordField input = (JPasswordField)e.getSource(); userString = input.getPassword(); now i'm very confused. I have no idea why i would need to do that. Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|