Thursday, April 10, 2008

Searching code

Google code search is truly brilliant.

Useful options
lang:java
Limits the search to Java code only, same works for many other languages see here.

Recently I wanted to look at some good examples of SwingWorker implementations.
And rather than doing the normal plain Google searches for "SwingWorker", or "SwingWorker example"/"SwingWorker tutorial", I thought i'd try code search. It worked really well and the best thing is, you get to see the code straight away instead of having to wade through download pages etc. It also has a very nice package hierarchy on the top left of any class so you can follow the usage of classes.

I searched for "extends SwingWorker lang:java".