If you don't see this exception consistently, a threading issue is certainly a possibility. Are you doing anything in the background, and then possibly closing a window when the operation completes?

If you are using threads in your app, you need to make sure that all UI operations execute on the event dispatch thread (same as Swing). You can do this by passing a Runnable to ApplicationContext.queueCallback().

Greg

On Sep 15, 2009, at 5:42 PM, Scott Lanham wrote:

There is no exception this time but the row editor doesn't appear at all if
invoked immediately after the new row is inserted.

On Wed, 16 Sep 2009 07:26:48 am Todd Volkert wrote:
Very interesting. The *only* way I could explain this error would be if a component was mucking with its parent's component collection in the body of validate(). Can you make the following change locally, re-run your test,
and send us the stack trace:

===================================================================
--- wtk/src/org/apache/pivot/wtk/Container.java    (revision 815485)
+++ wtk/src/org/apache/pivot/wtk/Container.java    (working copy)
@@ -321,8 +321,7 @@
            && isVisible()) {
            super.validate();

- for (int i = 0, n = components.getLength(); i < n; i+ +) {
-                Component component = components.get(i);
+            for (Component component : components) {
                component.validate();
            }
        }

Thanks,
-T

On Tue, Sep 15, 2009 at 5:08 PM, Scott Lanham <[email protected]> wrote:
On Wed, 16 Sep 2009 06:50:51 am Todd Volkert wrote:
Just following up on this thread, are you all set now Scott with the

newest

code from SVN, or are you still getting an exception?

-T

Hi Todd,

I still have the problem of adding a new record to the List bound to the TableView and then immediately invoking TableViewRowEditor on the row:

Exception in thread "AWT-EventQueue-0"
java.lang.IndexOutOfBoundsException at
org.apache.pivot.collections.ArrayList.get(ArrayList.java:358) at
org.apache.pivot.wtk.Container.validate(Container.java:325) at
org.apache.pivot.wtk.Display$ValidateCallback.run(Display.java:30)
       at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at

java.awt.EventDispatchThread.pumpOneEventForFilters (EventDispatchThread.j
ava:269) at

java.awt.EventDispatchThread.pumpEventsForFilter (EventDispatchThread.java
:184) at

java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.j
ava:174) at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: 169)
      at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: 161) at java.awt.EventDispatchThread.run(EventDispatchThread.java: 122)


Reply via email to