Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. java.lang.IllegalArgumentException: Index out of bounds
  2. at org.eclipse.swt.SWT.error(Unknown Source)
  3. at org.eclipse.swt.SWT.error(Unknown Source)
  4. at org.eclipse.swt.SWT.error(Unknown Source)
  5. at org.eclipse.swt.widgets.Widget.error(Unknown Source)
  6. at org.eclipse.swt.widgets.Table.getItem(Unknown Source)
  7. at org.eclipse.wb.swt.FortryApplication$2.handleEvent(FortryApplication.java:138)
  8. at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
  9. at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
  10. at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
  11. at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
  12. at org.eclipse.wb.swt.FortryApplication.open(FortryApplication.java:72)
  13. at org.eclipse.wb.swt.FortryApplication.main(FortryApplication.java:741)
  14.  
  15. table.addListener(SWT.Selection, new Listener()
  16. {
  17. @Override
  18. public void handleEvent(Event e) {
  19. Table table = (Table) e.widget;
  20. TableItem item = table.getItem(table.getSelectionIndex());
  21. if( e.detail == SWT.CHECK ) {
  22. System.out.println( "You checked " + e.item );
  23. if( table.indexOf( ( TableItem )e.item ) == table.getSelectionIndex() ) {
  24. TableItem ti = ( TableItem )e.item;
  25. ti.setChecked( !ti.getChecked() );
  26. }
  27. } else {
  28. TableItem ti = ( TableItem )e.item;
  29. ti.setChecked( !ti.getChecked() );
  30. }
  31. }
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement