listener

SWT AuthenticationListener Eclipse

Has anyone ever actually used the AuthenticationListener class in SWT? I downloaded the zip file named "eclipse-jee-galileo-M7-win32.zip" and according to the eclipse site this listener is available as of M6. When I open my project in the IDE this class is not there, nor is any other Authentication class (i.e addAuthenticationListener, A...

How to capture System.exit event?

hi, I have an application in java, in which i try to ensure that the if anybody exits codes System.exit() in the code , an listener should be called to do some stuff like logging message and releasing the resources ... How can i implement it, any suggestion/approach is welcome. ...

Android - basic gesture detection

I've been battling to get 'fling' gesture detection working on my Android application today. I've been looking at these sources; Detect Gestures - Tutorial SDK docs Calculator Code Nothing has worked for me so far and I was hoping for some pointers. What I have is a 'GridLayout' that contains 9 ImageViews. The source can be found he...

Method peaking my processor

Possible Duplicate: How do I start optimising my Java code? - CPU is at 100% I have a method isReset() that's executing like crazy i defined it as public boolean isReset() { return reset; } in another class. the class below is the only class that uses this code. import java.awt.BorderLayout; import java.awt.Dimension...

In TestNG in @AfterMethod how can I know the test result?

Hi! I have a number of TestNG test classes that all extend one base class AbstractIntegrationTest. In the superclass I have a mehod commonAfterMethod which is invoked after each test method and performs some clean-up. What I want is to do in this method something depending on the test result, e.g. if the test fails, I want to dump the ...

Design of listener for multiple events

I'm familiar with standard listeners, esp. in Java. For example, if you have a collection of objects, it might support a set of listeners for different things: CreateListener, ChangeListener, DeleteListener. Each has one method (e.g. objectChange) that is passed a list of affected objects. An app using this collection could register i...

Styles of adding / registering button listeners in OOP (Java, Actionscript, etc)

I've come across 2 different styles when adding button listeners in UI. I use SWT as example. But nonetheless I saw the similar code in J2ME, Flash Actionscript as well. style 1: b1.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { System.out.println("b1: "); } public void widge...

Adding mouseListener to my object in java

hi, I'm trying to make an applet which I can simply drag an image. And I want image object to listen events. So here is the applet code which simple run in a thread: import java.awt.*; import java.net.URL; import javax.swing.JApplet; public class Client extends JApplet implements Runnable { private static final long serialVersionUID =...

Flex PopUp Window Mate Listener and null object reference

There is a similar post here regarding this issue, but my problem is a little different. I have a PopUp window containing a form used to sign-up for access to a site. An event is generated from the PopUp via a Mate Dispatcher tag (Figure 1) validated in Flex and then sent to the server. Validation happens both in Flex and on the remote ...

How to add an eventListener to get event data from JWPlayer

I don't understanding what code is needed to simply output any interaction with the Flash JW Player. Below is a code demo from their documentation (results in addControllerListener being undefined). Some more details in the JW Player Flash API. function muteTracker(obj) { alert('the new mute state is: '+obj.state); }; player.addControll...

How to stop a process with time constraints

I think the topic might not be accurate enough, but I really don't know how to describe it in a very brief way... What I want to do is as follows: I have a process running some analysis (in Java) and trying to give a return value, but the whole analysis has a time constraint, say 10 seconds If the analysis gives a result within 10s, ...

Arraycollection not capturing the thrown event?

I have a collection of objects and each object throws an event every time its value gets updated. Im trying to capture that event by adding a listener to the arraycollection that holds it (see main class) but its not working. Honestly I'm not sure this is the correct approach. I'm avoiding using Collection.CHANGE because it fells into a...

Notify a Button if the number of files in a directory change

I have a button that I want to disable as long as there isn't a specific number of files in a directory. Is there some kind of listener that notifies me at the moment a file is created or deleted in a directory? ...

How to find out the instance when component resize is complete

In my application I fetch data if component is resized. I want to delay the fetch till user completes resize operation. ComponentListner event componentResized fires every time the window is resized. ...

JCheckbox change listener get's notified of mouse over events!

Please check out this piece of code and tell me why on earth does it print out to the console when you move your mouse over the check box? What is the "change" event that takes place? import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; public class Tes...

How to implement an XML-RPC server in AS3 (Flash or AIR runtime)?

I'm looking for a good XML-RPC server implementation to be included as part of an existing Flash+AS3 application in order to be notified on events by a client. The ideal implementation should be well written, documented, reliable and encapsulated in order to be easily and cleanly wrapped. EDIT: I'm working on porting the app on Adobe A...

Windsor Castle: Hooking up to container's resolving and releasing mechanism

I'm trying to implement automatic registration of my listeners to a singleton event aggregator when listeners are created by the IoC container - basically what Jeremy D. Miller is doing, but with Castle instead of StructureMap. So I want to be able to "intercept" Windsor's object creation mechanism and, if the object supports the marker...

action listening for a JFrame

I am trying to listen tab-in tab-out action for my swing gui that is made by JFrame. I have a JTextField added to the JFrame that will be getting the user clipboard whenever the window is selected so the user may tab between programs, copy some url so when back to my program, this JTextField will be populated by the copied url string. E...

Trace listener to write to a text box (WPF application)

For my WPF application I do logging to a text file using a TextWriterTraceListener. How can I also display the Trace output to a textbox? ...

Problem in Context Listener

I was trying to run a servlet using ServletContextListener ,I've put the codes from the book "Head-First" writter "Kathy sierra", but this is not working.Its shows 404 error.I have put the class files in the directory C:\Tomcat 5.5\webapps\Listener_exe\web-inf\classes\com\example. and web.xml file in web-inf directory. So please show whe...