Java Function as Parameter
<p>I am trying to add key press events to my library, so is it possible to pass a function as a parameter to one of my library's classes, then when my library needs to fire off that function?</p>

<p>example:</p>

<pre><code>Library lib = new Library();
lib.myAction(function(){
    // Do some java stuff here
});
</code></pre>

<p>So with that, when my library see something take place, such as a key press, it will fire off that function. If you have every worked with JavaScript you can do this (Really common with jQuery), and I would like to have the same effect but with Java.</p>
