• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Chice(drop down) items adding from database

 
Dhruva Mistry
Ranch Hand
Posts: 67
Eclipse IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic