pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashish Dalela <ashish.dal...@gmail.com>
Subject Re: Error in launching Pivot in a thread
Date Sat, 21 Apr 2012 20:03:35 GMT
Thanks for your responses. With your suggestion, I have partial success.
Here is what I did.

Created a Runnable class View that starts a thread. In the run () function
for this class, I call the queueCallback () to invoke a StartGUI Runnable
instance. This starts the Pivot application alright.

However, when I do a thread.join for the View (and other threads) in main
thread the GUI is never rendered. Any suggestions on what maybe wrong?

Ashish


On Sat, Apr 21, 2012 at 10:54 PM, Noel Grandin <noelgrandin@gmail.com>wrote:

> You should be using ApplicationContext#queueCallback() to push code
> onto the event thread, so that your other threads do not need
> to call pivot stuff directly.
>
> On Sat, Apr 21, 2012 at 18:24, Ashish Dalela <ashish.dalela@gmail.com>
> wrote:
> >
> > The issue is that if I have multiple threads then I have to also be doing
> > thread.join for the other threads, which in effect suspends the main
> thread
> > until the other threads exit and makes the window unresponsive.
> >
> > I thought this is what PIVOT-780 is about, but I might be wrong.
> >
> > Ashish
> >
> >
> > On Sat, Apr 21, 2012 at 8:53 PM, Noel Grandin <noelgrandin@gmail.com>
> wrote:
> >>
> >> You can only call window.open from the event thread, not from other
> >> threads.
> >>
> >>
> >> On Sat, Apr 21, 2012 at 14:00, Ashish Dalela <ashish.dalela@gmail.com>
> >> wrote:
> >> > Hi,
> >> >
> >> > I'm a new user, and hope I can find some help here.
> >> >
> >> > I have a MVC application, with each M/V/C run in separate threads. The
> >> > Pivot
> >> > code runs in the View thread, and I see the following error at
> startup:
> >> >
> >> > Exception in thread "Thread-6" java.lang.IllegalStateException: this
> >> > method
> >> > can only be called from the AWT event dispatch thread, and not from
> >> > "Thread-6"
> >> >
> >> > The error is seen while executing the following code:
> >> >
> >> > <snip>
> >> > this.window = (Window)
> >> > bxmlSerializer.readObject(getClass().getResource("abc.bxml"));
> >> > window.open(this.display);
> >> > </snip>
> >> >
> >> > A similar issue seems to have been reported and (apparently) fixed
> >> > earlier: https://issues.apache.org/jira/browse/PIVOT-780
> >> >
> >> > I'm wondering if this is regressed, or what is the right version to
> get
> >> > this
> >> > fix? I'm using 2.0.1.
> >> >
> >> > Thanks for any help,
> >> >
> >> > Regards,
> >> > Ashish
> >
> >
>

Mime
View raw message