Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

2012-05-26

Elegant Event Handling in Java

Here's a comment I added to a great post with a very nice piece of Java code:
Elegant Event Handling in Java

Yes, that's very elegant. I was implementing some Java class, when I went "hey, I need to handle events". I know how to do this in Delphi and .NET/C#, and I know how to use Swing events (even if I don't really like their approach).

So I've looked into JButton searching for "actionPerformed()" method, but no luck.
Then I went to AbstractButton and found "fireActionPerformed()" - which looked pretty ugly.
I even went to EventListenerList - to confirm my suspicion, that there is a mess in Java regarding events. And it is inherited from old, pre-generics, Swing design.

I knew there must have been some better way.

I've found Mr HappyObject - funny, but not so useful.
Then this: How To Create Your Own Events In Java - little better, and with synchronized methods (nice bonus).
This one looked promising: Generic event code - quite promising, but I kept on looking.

But your code is the best so far. I'm going to test it and will probably use it in my internal, little project.

Thanks a lot!

And here is a link to original code on GitHub: EventListeners.java

2009-02-08

How to customize NetBeans look and feel

A good overview of possible options for custom look and feel in NetBeans can be found here:

http://javahowto.blogspot.com/2008/05/how-to-customize-netbeans-look-and-feel.html

Apart from original tip concerning MetalLookAndFeel, the above is a nice source of ideas, which I like a lot. :-)

2008-04-24

Run NetBeans using custom Look&Feel

Original at: http://wiki.netbeans.org/FaqCustomLaf

After installing NetBeans on Ubuntu one simply needs to add the relevant launcher to a panel, and then modify the command, for example:

/bin/sh "/opt/netbeans-6.5/bin/netbeans" --laf javax.swing.plaf.metal.MetalLookAndFeel

(all in one line, of course)

2007-07-01

Choosing the Right Architecture - eBook

Choosing the Right Architecture: What It Means for You and Your Business
http://cp.jupiterweb.com/index.php/3806_architecture/084c5c900ab38c5c07f95aaadb4c44db?js=1
This custom eBook from DevX and IBM Rational explains why choosing the correct architecture early in your development process is essential for success - both for your business and for you, personally, as a developer.

2004-03-25

Eclipse Tomcat plug-in

http://www.sysdeo.com/eclipse/tomcatPlugin.html (broken link)