listener

how to disable gps lookup in android again

How am i able to Stop GPS from receiving new signals? was searching for it, just use: if u initialize a LocationsManager Object mLocationManager_ = (LocationManager) mContext_.getSystemService(Context.LOCATION_SERVICE); add an location listener, GPS is starting to a GPS-Lock, mLocationListener_ = new MyLocationListener(mContext_); ...

StackOverflowError when trying to deploy an application to Weblogic ?

I am working on a J2EE application, to deploy I am using a build.xml (which is used by all team members) to create ear & publish, after the BUILD SUCCESSFUL message appears in Eclipse, I start Weblogic 10.3.2 but weblogic doesn't start properly and shows the following error message in the console: SLF4J: Class path contains multiple SL...

Does Events in java are treated in a separated thread or I have to do it myself?

Im pretty new to programming....so I am making a music Player that needs some features I need to treat one Event at the same time in 2 classes. For example... The Player is plaing music on its own thread, when this music is done, it fires musicFinished(MusicEvent), go to the Playlist class and asksForAnotherMusicToPlay(), then starts pl...

nhibernate auditing with events on update

The following code works on insert but on update modifier is never set, any ideas why? The code for pre-update is being run and correctly sets the state and entity values to the desired value. However when viewing the generated sql nhibernate does not include the field in the update query. /// <summary> Updates auditable objects </summ...

Java Swing: Process won't close after adding mouse listener

I want to know what the issue is when I try to close my Java Swing application when I add a listener to the form frameview. Here's how to produce my problem: In Netbeans, create a new Swing application project, then in the main class, create a local method that adds an empty mouse listener to the main window via this.getMainFrame().addMo...

How to listen componentShown/componentHidden events better than ComponentListener?

I want to be informed if componentShown/componentHidden event occured. I use ComponentListener, but it doesn't work as good as I need. I have found this information in official Swing tutorial: The component-hidden and component-shown events occur only as the result of calls to a Component 's setVisible method. For example, a ...

Create Listener similar to MouseListener

I want to create a listener that works like mouselistener, but it must be a component: F.e. i have two JComponents (One is a button, and second is MyComponent), and i want to do following: button.addMyComponentListener(listener); And if MyComponent for example has moved above button, it must fires an event, or if MyComponent has change ...

How we will access to the database from AuditTrailInterceptor?

Hi, I'm trying to access the database from Hibernate Interceptor (I need to audit only specific objects that are defined in a different table) and the access is impassable (I get exceptions). Is there a way to access database in interceptor? My AuditTrailInterceptor is: public class AuditTrailInterceptor extends EmptyInterceptor { ...

Java applet - mouse and key listener

Is there a way to implement a KeyListener and MouseListener in the same applet? I already tried any ways I thought that would work and I tried Google. :\ my try: C:\Users\Dan\Documents\DanJavaGen\tileGen.java:23: tileGen is not abstract and does not override abstract method mouseExited(java.awt.event.MouseEvent) in java.awt.event.Mouse...

[Android] LocationsListener does not stopp - even if removeUpdates called

Hey guys, I've a really strange problem, I'm getting location updates with a GPS Listener, everything works fine. I also watch this listener with a timeout, if the timeout gets exeeded, it stops the thread, removesLocation updates everything works... BUT, if there's no Internet Connection available, an exeption gets called, it should ...

How can an java event listener defined as an anonymous inner class use a variable from an enclosing class?

Here's the code: protected Dialog onCreateDialog(int id) { Dialog dialog = null; if (id == DIALOG_SEARCH) { dialog = new Dialog(this); dialog.setContentView(R.layout.search_dialog_layout); dialog.setTitle("Search Dialog"); Button button = (Button) dialog.findViewById(R.id.Button01); final ...

Doctrine Record Listener

I have a listener which contains a preSave() method. Is there a way for me to halt doctrine from calling the save method if a condition fails. Unfortunately I am not allowed to throw an exception. Is there any other way? ...

Using DocumentListener to update Text Field

So I am implementing DocumentListener in order to make a search text field that will perform searches as the user types. All of that is working correctly, but I recently also discovered a need to modify what the user has put into the text field. For example, I have a function that is removing any character not in the extended ascii set, ...

Bizarre NHibernate exception: 'Uninitialized proxy passed to save().' caused by factory event configuration

There mere presence of a custom DefaultSaveEventListener subclass containing no overidden or extended behaviour is enough to trigger this bizarre exception for me when flushing or committing a transaction, using the following configuration Xml: <event type="save-update"> <listener class="MyNamespace.MyCustomSaveEventListener, MyAsse...

Android OnClickListener - identify a button

Hey. I have the activity: public class Mtest extends Activity { Button b1; Button b2; public void onCreate(Bundle savedInstanceState) { ... b1 = (Button) findViewById(R.id.b1); b2 = (Button) findViewById(R.id.b2); b1.setOnClickListener(myhandler); b2.setOnClickListener(myhandler); ... } View.OnClickList...

How to click or tap on a TextView text

I know this is so easy (doh...) but I am looking for a way to run a method on tapping or clicking a TextView line of text in an Android App. I keep thinking about button listeners and anonymous method listener calls, but it just does not seem to apply to TextView. Can someone point me at some code snippet to show how clicking or tappin...

Trouble triggering onKey event with Android.

I'm having difficulty getting my main View's onKey event to trigger. I'm not sure what I'm doing wrong, I have correctly implemented the onClick event but cannot seem to figure out the onKey event. Here's the relevant code: public class MyActivity extends Activity { private RelativeLayout main; private ApplicationToolbar toolb...

Observer Design Pattern vs "Listeners"

It seems to me that the Observer design pattern as described in GOF is really the same thing as Listeners found in various toolkits. Is there a difference between the concepts, or are Listeners and Observers really the same thing. (I'm not looking for any specific computer language implementation, I just want to understand the differen...

SQL Server Database Change Listener C#

I want to listen for changes to data in a SQL Server database from C#. I was hoping that there would be some sort of listener which I could use to determine if data that I have is stale. Despite being a fairly common scenario I can't find any solutions which aren't to simply poll the database. I use Linq-To-SQL to access the data and he...

Is there a way to listen for the completion of a MovieClip playing?

I want to execute a function upon completion of a MovieClip's animation. That is, I would command it to play() or gotoAndPlay(). I don't know of any listener that I can attach to the MovieClip with the "addEventListener()" command. Have any idea I can do? ...