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 - ComboBox removeAllItem/RemoveItemAt
Summary: ComboBox removeAllItem/RemoveItemAt
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 8.0.2
Hardware: PC Windows 10 x64
: P1 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-24 16:18 UTC by jlohmann
Modified: 2015-10-26 08:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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