listeners

How to listen to elements method calls in Javascript

Hello, I would like to listen to method calls. For example, when an element is appended by anything to the document, I would like to be passed that element to act on it, like: //somewhere aParent.appendChild(aChild); //when the former, a function I defined as listener is called with the aChild as argument Does anybody know how to d...

Swing: Is there a way to differentiate between a user-caused ItemEvent and an application-caused one?

I'm working with a combobox in a Swing-based application, and I'm having a hard time figuring out what to do to differentiate between an ItemEvent that is generated from a user event vs one caused by the application. For instance, Lets say I have a combobox, 'combo' and I'm listening for itemStateChanged events with my ItemListener, 'l...

Starting multiple HTTP listeners on IIS using C#.NET 2.0

Hi, I have two windows services running on the same machine. Both the services uses private HttpListener listener; I specify the baseURL as "http://IPAddress:8080/" & "http://IPAddress:8081/" respectively for each of the services. Then I do the needful and call listener.Start(); The first service starts successfully at 8080 port. Bu...

Enterprise Library Logging: TraceListeners Question.

Is it possible to log certain events to -> event log for example, while others to -> file trace listener, while others still to -> SQL database. I want to be able to configure this somewhere so errors go to text, verbose information goes to SQL, and warnings go to (event viewer and text). Is this type of thing possible? ...

Getting ENTER to work with a JSpinner the way it does with a JTextField

First, to make my job explaining a bit easier, here's some of my code: JSpinner spin = new JSpinner( ); JFormattedTextField text = getTextField( spin ); text.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed( java.awt.event.ActionEvent evt ) { // Do stuff... } ...

How can a JComponent notified about the closed event of it's parent J(Internal)Frame?

I want to write a component that monitors other activities, but it's listeners are to be removed when the component's window is closed. I don't want to write this removal code many times, but want the component to handle it itself. (How) can i do it? Thanks! ...

Monitor Directory for Changes

Much like a similar SO question, I am trying to monitor a directory on a Linux box for the addition of new files and would like to immediately process these new files when they arrive. Any ideas on the best way to implement this? ...

How do I remove an event listener from an anonymous component?

Say I have an event listener tied to a component and I want to remove the event listener from the component so it can be garbage collected. The problem is I don't know what kind of object it is or what event listeners it has. Basically how can I find out what event listeners an object has and how can I remove one or all of them? ...

Most compatible way to listen for database changes?

I have a process that reads raw data and writes this to a database every few seconds. What is the best way to tell if the database has been written to? I know that Oracle and MS-SQL can use triggers or something to communicate with other services, but I was hoping there would be a technique that would work with more types of SQL databas...

How can I use listeners to access other elements?

I'm setting up a GUI where I need to take information inputted from form elements and manipulate the information. This requires me to use some elements to access others. For example, I have an input box (JTextField) and a button (JButton) beside it. When the button is pressed, I need to be able to manipulate the text entered into the in...

How to use something other than the DefaultClosingOperation when closing a JFrame window?

Hi, I am working on a chat client using a socket, and I want a certain code to be executed before the window closes when the user clicks on "X" (like closing the connection properly). Can I do that without having to implement all the abstract methods in WindowListener? /Avin ...

NHibernate: difference Interceptor and Listener

Looking at all the possibilites of creation / update columns in NHibernate I mostly (Stackoverflow question, Ayende Rahien) see solutions with Listeners. The programmer who was programming this in my company used an Interceptor to achieve the same thing. Is there any difference between those two solutions ? (Is on of them obsolete, is...

AS3 Project - Mouse Move Listener Reacting Outside of Application

I'm getting an unusual behavior that I can't seem to get to the bottom of. When I run this, if I move in the swf area it traces normally on mouse move. To be expected. But it's tracing for the move event when I click anywhere on screen. If I click and drag, it traces as if I were moving in the swf area of the browser. Here's the code. ...

'chain' a series of functions together in actionscript 3

Hi All, I'm calling a function and adding a listener for when the function returns some data. when the data is returned i need to call another function and so on. Is there an easy way to 'chain' these functions together so that the first one fires - waits for the listener then fires the second one creating a listener for that and so on...

How to direct the EventLogTraceListener to create in a specific Log

The following listener will create an event entry when the Trace.WriteLine is called. If the source does not exist he will create it in the default log channel which is 'Application' . I want to specify another default Log channel but after searching for 45 minutes i don't seem to find the solution. Any ideas? <configuration> <syst...

Dynamically Adding Listeners To Google Maps Markers

I'm working on a page which fetches code with a Javascript httpObject and uses it to update two elements on the page - a google map, and a DIV that lists the things the marker points to. That bit works fine. The problem is that when I create the markers, I do so through a for loop, and I add listeners to the marker in each loop. Then,...

A class which implements mouseLIstener and mouseMotionListener in java...

Hi all. I have a question about a class which implements both mouseListener and mouseMotionListener in java. I've recently been splitting up my mouse listeners into different modes in this game I'm making in java, and came across a funny issue when dealing with the Build Item listener. For the game panel, I used two methods to reset t...

Properties File listener in Java?

I have properties file. I want to use listeners. if some Values change in this file then i want to update my integers. So, Which classes or implements do i need to use? ...

reference problem when reaching ResourceMap's String?

I have been developing desktop application in Java. Here, it shows how i reach string of Properties file. Key-value of String is HDI.Device.1.ID org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(HDIManagementApp.class).getContext().getResourceMap(HDIManagementView.class);String ID=resour...

Will the listeners be removed when we call $.remove() in jQuery?

... There are listeners on $('#target') and its children. When we call $('#target').remove() to delete it from DOM,will the listeners be removed? If not,how to remove them together? ...