Re: Swing event priority
- From: "John McGrath" <ng@xxxxxxxxxxxxx>
- Date: Tue, 05 Apr 2005 04:20:53 GMT
On 4/3/2005 at 10:15:48 PM, Hegemony Cricket wrote:
> My application has a JTabbedPane. On one of its panels there's a button,
> that does a slow operation. Surprisingly to me, if I click the button
> multiple times, then click one of the other tabs on the JTabbedPane, the
> pane-switching event is occurring before all the button clicks get
> handled.
Are you performing the slow operation in the Event Dispatch Thread? I
presume you must be, since if you were spawning a background thread, then
the behavior you describe would be the obvious, expected behavior. If so,
then that is definitely not a good idea. Consider running the operation
in a separate thread. You will probably want to disable the action while
it is running.
--
Regards,
John McGrath
.
- References:
- Swing event priority
- From: Hegemony Cricket
- Swing event priority
- Prev by Date: Mixing Swing and SWT?
- Next by Date: Unable to set focus on the JTextField
- Previous by thread: Re: Swing event priority
- Next by thread: Re: JTable - Row Sellection
- Index(es):