I am populating each cell of a table with drop down lists, I have 2961 rows in my table, here is the code:
TableItem[] items = table.getItems();
for (int i = 0; i < 1000; i++) {
TableEditor tableEditor = new TableEditor(table);
CCombo combo = null;
combo = new CCombo(table, SWT.NONE);
combo.setText("CalleesExecuted");
for(Method2Representation caller:methodtraces2.get(i).getCalleesListExecuted()) {
combo.add(caller.toString());
}
tableEditor.grabHorizontal = true;
tableEditor.setEditor(combo, items[i], 13);
}
the code works fine for i<1000. However, when I use i<2961, which corresponds to the number of rows that needs to be input within my table, I get the error:
Exception in thread "main" org.eclipse.swt.SWTError: No more handles
at org.eclipse.swt.SWT.error(SWT.java:4559)
at org.eclipse.swt.SWT.error(SWT.java:4448)
at org.eclipse.swt.SWT.error(SWT.java:4419)
at org.eclipse.swt.widgets.Widget.error(Widget.java:482)
at org.eclipse.swt.widgets.Control.createHandle(Control.java:718)
at org.eclipse.swt.widgets.Composite.createHandle(Composite.java:292)
at org.eclipse.swt.widgets.Decorations.createHandle(Decorations.java:430)
at org.eclipse.swt.widgets.Shell.createHandle(Shell.java:593)
at org.eclipse.swt.widgets.Control.createWidget(Control.java:758)
at org.eclipse.swt.widgets.Scrollable.createWidget(Scrollable.java:151)
at org.eclipse.swt.widgets.Decorations.createWidget(Decorations.java:439)
at org.eclipse.swt.widgets.Shell.<init>(Shell.java:300)
at org.eclipse.swt.widgets.Shell.<init>(Shell.java:379)
at org.eclipse.swt.custom.CCombo.createPopup(CCombo.java:472)
at org.eclipse.swt.custom.CCombo.(CCombo.java:158)
at mygui.createContents(mygui.java:184)
at mygui.open(mygui.java:60)
at mygui.main(mygui.java:49)