This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256152

Summary: ComboBox removeAllItem/RemoveItemAt
Product: java Reporter: jlohmann
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: RESOLVED INCOMPLETE    
Severity: normal    
Priority: P1    
Version: 8.0.2   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: DEFECT Exception Reporter:

Description jlohmann 2015-10-24 16:18:34 UTC
If there is a problem with the code in the path in which the combobox.removeAllItems call is made, it can be before or after the call to removeAllItems, removeAllItems will have an exception. Even though I knew there were Items in the combobox, I put an if and checked the count greater then zero and it the count came back greater then zero so even the combobox thought it had items.  In my code the user presses a button, in the code associated with the button, the contents of the box is removed and new content put in the box.  When an item is selected from the new content, a different class is called to handle the selection.  When I remove the call to the other class, everything works, but with the call to the other class, the combobox fails on removeallitem under the code for the button.  If the count is zero, the removeallitems should still not fail, but handle the issue gracefully.  This issue is a big problem.
Comment 1 Jiri Prox 2015-10-26 08:54:24 UTC
Can you please provide code and the stacktrace of the exception?

Anyway, it looks like error in your code, not in Netbeans itself