473,395 Members | 1,368 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,395 software developers and data experts.

get event name????

I have component X that writes xml and gets name and value from components
Y,Z.

since cmponents Y,Z are the same but with idfferent name when i try to catch
their name with source

evt.getSource().getClass().getCanonicalName();

I get the same name.

How do i get the name of every component?

Feb 4 '06 #1
1 4782
"sight" <bl***@bljak.spam> wrote in news:ds**********@bagan.srce.hr:
I have component X that writes xml and gets name and value from
components Y,Z.

since cmponents Y,Z are the same but with idfferent name when i try to
catch their name with source

evt.getSource().getClass().getCanonicalName();

I get the same name.

How do i get the name of every component?


I think that by "component" you mean "instance of an object".
I think that by "name" you mean "an object's unique identifier".
If this is what you meant, I think that you are out of luck. In Java,
objects don't have unique identifiers unless they are designed and
implemented that way.

Sometimes, hashCode() and toString() are of some use, but they are NOT
guaranteed to be unique.

You may want to rethink what you are trying to accomplish, and how you are
trying to accomplish it.

On the other hand, your object X is certainly entitled to keep its own list
of objects (say, a java.util.Hashtable) and to provide its own "name" for
each new instance as it is encountered.
--
Ian Shef 805/F6 * These are my personal opinions
Raytheon Company * and not those of my employer.
PO Box 11337 *
Tucson, AZ 85734-1337 *
Feb 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
3
by: jg | last post by:
In windows project with only one single class and the start-up object is the form itself. form load event seems to be before the form is loaded How do I create a post form loaded event? I am...
9
by: AG | last post by:
Using VS 2005. Usually I work in VB.NET. In code behind when I need to add code to an event, I just select the object in the upper left dropdown of the code window and then the desired event in...
1
by: =?Utf-8?B?S2llcm9u?= | last post by:
Hi, How do I reliably find the name of the event (e.g Click, SelectedIndexChanged etc) that caused a page to post back. Is there somewhere in the Asp.Net pipelines we can hook into and discover...
1
by: Mike | last post by:
I have the following function for firing various events. Is there a way to get the name of the event I am firing using only the info already provided to the function? I don’t want to add another...
15
by: Phillip B Oldham | last post by:
Are there any python event driven frameworks other than twisted?
5
by: puzzlecracker | last post by:
public delegate MessageHandler(Request request) public sealed class Connection{ public event MessageHandler handler; private void ExecuteMassageHandler(Request request) {
4
by: tshad | last post by:
I am just getting started with events and had a couple of questions on why they do what they do. If you have a textbox and you want to handle an event you can just do: ...
0
by: vira raghavaiah | last post by:
Nero Problem signature: Problem Event Name: BEX Application Name: NeroVision.exe Application Version: 5.2.7.0 Application Timestamp: 475fcbec Fault Module Name: MSVCR80.dll Fault...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.