By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,775 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,775 IT Pros & Developers. It's quick & easy.

Custom event without EventObject class

P: n/a
P
Hello,
I need to use events in MIDP2.0, where EventObject class does not
exist. I have built a custom event WITHOUT using EventObject (see code
below: //Initially //Final) and, apparently, it has the same behaviour
as the same one extending this class. My question is:
Is it possible to build a custom event without extending EventObject
that has the same behaviour as one which extends class EventObject?
What am I missing?

//public class MyEvent extends EventObject {//Initialy
public class MyEvent {
Object _source; //Final
private MyEvent _myEvent;

public MyEvent( Object source, MyEvent myEvent ) {
//super( source );//Initially, but canīt do this now
_source=source; // now
_myEvent = myEvent;
}
public Object getSource(){ // This method was not here before, but
it is now
return _source;
}

Thank you,
P
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
to*****@hotmail.com (P) wrote in message news:<f4**************************@posting.google. com>...
Hello,
I need to use events in MIDP2.0, where EventObject class does not
exist. I have built a custom event WITHOUT using EventObject (see code
below: //Initially //Final) and, apparently, it has the same behaviour
as the same one extending this class. My question is:
Is it possible to build a custom event without extending EventObject
that has the same behaviour as one which extends class EventObject?
What am I missing?

//public class MyEvent extends EventObject {//Initialy
public class MyEvent {
Object _source; //Final
private MyEvent _myEvent;

public MyEvent( Object source, MyEvent myEvent ) {
//super( source );//Initially, but canīt do this now
_source=source; // now
_myEvent = myEvent;
}
public Object getSource(){ // This method was not here before, but
it is now
return _source;
}

Thank you,
P
No problem if you implement your own event firing/listening framework from scratch.

BTW public MyEvent( Object source, MyEvent myEvent ) {

^^^^^^^^^^^^^^^
What is this?
Jul 17 '05 #2

P: n/a
P
Thank you very much for your help. Sorry for the constructor, I typed
it wrong, it shouldnīt be
public MyEvent( Object source, MyEvent myEvent )
but
public MyEvent( Object source, MyValue myValue)

Then, what is the difference between using EventObject or not?
Thanks again,
P

No problem if you implement your own event firing/listening framework from scratch.

BTW
public MyEvent( Object source, MyEvent myEvent ) {

^^^^^^^^^^^^^^^
What is this?

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.