my dog learned polymorphism
The moose likes Applets and the fly likes Chice(drop down) items adding from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Chice(drop down) items adding from database" Watch "Chice(drop down) items adding from database" New topic

Chice(drop down) items adding from database

Dhruva Mistry
Ranch Hand

Joined: Nov 21, 2008
Posts: 67

Hello friends,

i can't post my code but i can only give idea what i tried

i need to take values from a database field and show in choice object to choose any one of them
i have method in applet
project having some model java file to set commands and set related variables and objects
i added a command to get details from database and added database functioning method in model file

on applet file,in method i made a choice object
i call method to set command to getDetails
i code to remove all existing items from choice
i checking in for loop for the no. of records in database existing and in loop i trying to add as choice items by casting the vector object i am storing the database value to String
then i wrote code to select 1st record to select by default and the i coded to show the choice object
and after that i am adding in Panel to show on screen

i am getting : stating null-pointer exception at the code line where i call method to set command for model class

i am stuck now... any helps will be helpful
please help me

thank you all in advance

Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

Null pointer exception? That means you're trying to use a method of a variable which contains a null reference. You will have to fix your code so that it doesn't do that.

The stack trace tells you the line number where the error occurred.

That's about all it's possible to say without seeing any code. Good luck with your problem.
I agree. Here's the link:
subject: Chice(drop down) items adding from database
It's not a secret anymore!