Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Re: errors in H...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 6 Topic 16046 of 16590
Post > Topic >>

Re: errors in Hashtable to HashMap

by "Matt Humphrey" <matth@[EMAIL PROTECTED] > May 2, 2008 at 12:58 PM

"bH" <bherbst65@[EMAIL PROTECTED]
> wrote in message 
news:2a2e1dbf-fcdc-49ed-88c0-ec7025e07ca4@[EMAIL PROTECTED]
 May 2, 10:33 am, Roedy Green <see_webs...@[EMAIL PROTECTED]
>
wrote:
> On Fri, 2 May 2008 05:34:40 -0700 (PDT), bH <bherbs...@[EMAIL PROTECTED]
>
> wrote, quoted or indirectly quoted someone who said :
>
> >Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
> > at TestPhneDialer.action(TestPhneDialer.java:30)
>
> Since the listing you post has no line numbers, we can't easily tell
> what that is pointing to. Add a comment to point it out.
> --
>
> Roedy Green Canadian Mind Products
> The Java Glossaryhttp://mindprod.com
> Hi Matt,
> The suggestions that you made do not fix the situation :(

Perhaps you have more than one error.  Exactly what did you do and what 
error is it producing?  Are you sure the browser isn't caching your
applet? 
You are definately declaring the variable twice.

> This is the line 30 that is in error:
> String name = new
> String((String)buttonSoundNames.get((Button)e.target));
>
> P.S. I think that this error happens because the buttonSoundNames is
> .not
> available at this line(not readable at this point in the program).
> But that is just my dumb guess.

You know (and can test) that buttonSoundNames is null at this point.  Now 
work backwards and ask yourself what conditions are needed in order for it

to be null. Perhaps init() is not called, the initialization is shadowed, 
the applet has been cached, etc.  Then test each of these hypotheses.

Also, it's not meaningful for the HashMap loadfactor to be > 1. 
Essentially, you're saying that when a table of size 3 contains more than
9 
elements it should be resized.

Matt Humphrey http://www.iviz.com/
 




 6 Posts in Topic:
errors in Hashtable to HashMap
bH <bherbst65@[EMAIL P  2008-05-02 05:34:40 
Re: errors in Hashtable to HashMap
"Matt Humphrey"  2008-05-02 09:24:27 
Re: errors in Hashtable to HashMap
Roedy Green <see_websi  2008-05-02 14:33:09 
Re: errors in Hashtable to HashMap
bH <bherbst65@[EMAIL P  2008-05-02 08:13:11 
Re: errors in Hashtable to HashMap
"Matt Humphrey"  2008-05-02 12:58:05 
Re: errors in Hashtable to HashMap
bH <bherbst65@[EMAIL P  2008-05-02 16:38:33 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 14:38:13 CST 2008.