Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Event Listeners

807589Dec 1 2008 — edited Dec 1 2008
Hi,
I'm working all afternoon (European timings ;) on a problem with event listeners. I use an API, for recognising Wii mote events, but I think the principle will still be the same.

This is the relevant code for the app
...
public AppBegin(){
		Wiimote[] wiimote = WiiUseApiManager.getWiimotes(1, true);
		wiimote[0].addWiiMoteEventListeners(new MyClass());
	}
...
Now I also have a class called MyClass, which is the event listener. Basicl:
public class MyClass implements WiimoteListener{
  ...
  public void onAction(){
    // here something happens.
  }
  ...
  
  public static void main(){
    stuff
  }
}
I want that when something happens (See comment) the eventListener gives this information to the main class. How can this be done?

Thanks!
Jan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 29 2008
Added on Dec 1 2008
7 comments
102 views