I created a java Applet. It has an error. The error is applet not initialized.
I need urgent help for this error. I created the interface using netbeings & coppied the code to the Jcreater. :(
Naween -2 Newbie Poster
Recommended Answers
Jump to PostYou need to instantiate choice1 before you add the string item. So change
choice1.add("10 oz"); choice1.add("16 oz"); Choice choice1 = new Choice();
to
Choice choice1 = new Choice(); choice1.add("10 oz"); choice1.add("16 oz");
Jump to PostBe aware that you have re-declared all of your class-level component variables in your init() method, so if you refer to any of those outside of init() you'll find they are null and none of your listeners will work as you expect.
All 5 Replies
jasimp 427 Senior Poster Featured Poster
Naween -2 Newbie Poster
jasimp 427 Senior Poster Featured Poster
peter_budo commented: Nice of you to help him +10
Naween -2 Newbie Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.