473,385 Members | 1,824 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Custom event without EventObject class

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
2 4045
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Steve Amey | last post by:
Hi all I am creating a basic control to perform some tasks, and I want to declare some events to be raised so they can be handled from the form that the control is on. I can create my own Event...
7
by: Luc Tremblay | last post by:
Given the typical following code: void Listener::HandleEvent(const Event& event) { // handling code } In a "clean" fashion, how is it possible to add custom data (to be subsequently...
15
by: Tinus | last post by:
Hello all, I've created a custom control that draws a monthly schedule (using the Draw function in C#). Basically it draws 31 boxes and writes the day number in every box. This works...
1
by: Beren | last post by:
Hello With trial and error I'm attempting to create an extended identity to store some more data than just the Name, for example a Subscription and a LastSearchPerformed property... Is this a...
26
by: johkar | last post by:
I need to cancel the link and execute a function onclick of all the links within the span tag which has a class of "container" assigned. There will be only one span tag with this class applied. ...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
1
by: rn5a | last post by:
I have created a custom control button which when clicked displays a message in the JavaScript alert dialog. I could successfully compile the VB class file into a DLL & also could add it to the...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
1
by: stmfc | last post by:
hi, for an event handling mechanism, we need an event object. (the object where the event actually occur) and we need an event handler, and we need a registration of the event handler to the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.