Skip to content

category / Code

Writing code is like writing poetry – do it right or you’ll end up in some anthology of shame.

Java Global JFrame Key Listener

Do you know what happens when you add a KeyListener to JFrame to capture global keystrokes? Nothing. Much to my frustration, I discovered recently that KeyEvents are not bubbled up through the JComponent hierarchy by default. The only component that consumes the event is the one currently focused.

Project Espresso4J – Java inline arrays, lists, and maps

Java 7’s recent release has sparked some interesting discussion, some excited by the new features, some disappointed that it’s too little too late… But this isn’t one of those internet rants about the future of Java; this is about using a language to its full extent!

PHP Puzzler: Forgetful Variables

Today I present to you a PHP puzzler that in fact had me stumped for a day or two. I do enjoy when a language throws a curve ball; it presents an opportunity to gain insight on the mechanics and become acquainted with the nuances of the language in question.