Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I used JComboBox.. to remove all the items in the JComboBox. I used 'removeAllItems()' in 'ItemStateChanged' event but in runtime while changing items "java.lang.NullPointerException" error occurs.. but the component has items it's not null, but the error comes.. I can't find why..?

Please help me by giving a correct implementation for it.
Posted
Updated 24-Apr-11 21:52pm
v3

1 solution

java.lang.NullPointerException
This simply means that you are trying to access a property of an object that is NULL.

For full details, look here.[^]

A simple use of DEBUGGER can tell you which object is null on the line that is throwing the error. Find it and handle it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900