Support to custom events

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, 99jonathan, imaqine

Support to custom events

Postby tamasu » Sun Nov 25, 2012 12:24 am

Hi,

I was wondering if lejos can support custom events. I have a thread which attempts to connect to another NXT. I wish that when the NXT 1 fails to connect to the NXT 2 the user is prompted with a message stating if he wants to retry. In order to this I thought of firing an event which is captured by a listener set in the main class.

Unfortunately it seems that java.util.EventObject cannot be imported. Therefore here I am assuming that custom events are not supported, but appreciate if you could confirm this.

If I am not able to use custom events is there another method which I can use so that I can achieve the same idea?

Thanks a lot for your assistance
tamasu
New User
 
Posts: 7
Joined: Sun Nov 25, 2012 12:14 am

Re: Support to custom events

Postby skoehler » Sun Nov 25, 2012 1:09 am

You can the classic synchronization mechanism that Java offers (synchronized, wait, notify) to implement what you're asking for.
skoehler
leJOS Team Member
 
Posts: 1108
Joined: Thu Oct 30, 2008 4:54 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 2 guests

cron
more stuff