Counting the Days Between Two Java Dates using a Gregorian Calendar

Today I needed to figure out a way to count the number of days between two dates in Java. There are no API methods that will do this for you so a little work is required to achieve this. This post illustrates the solution I came up with.

The Details of Member Level Inner Class Syntax

Inner classes offer are a powerful extension to Java’s object model. However, the syntax for some of the more advanced features of member inner classes is quite tricky to get to grips with. In this article I’ll explain the full details of this syntax.

An Explanation of ‘this’ in Java

As every Java programmer should know, code within any non-static method can access the current object via a special reference called ‘this’. Just how this works may not be immediately obvious so I’ve taken a moment to explain it here.

Programming with Inner Classes in Java

Inner classes are an advanced programming feature in Java. They add another dimension to the concept of Object Oriented programming by allowing objects to not only reside alongside one another, but also within one another too. In this post I’ll explain how inner classes work with the help of an example that illustrates their most common use: Swing GUI programming.

How to strip accents from Strings using Java 6

I recently needed a function for stripping characters from a String in Java to make searching for words in a text simpler.
Luckily I was using Java 6 which has a new class in the java.text package that provides a really simple solution for doing this: the Normalizer.
The Normalizer class is capable of performing decomposition of [...]

Using the JForum SSO plug-in from Grails

How to apply Single Sign On (SSO) to JForum from within a Grails application.

InteliJ IDEA is now open source!

IntelliJ have open sourced IDEA. What does this mean to the Java and Groovy/Grails communities?

How to update your Twitter status using Java

Twitter provide a RESTful API that allows third party applications to access and use their services. In this post I’ll show you how to submit a status update using the this API from a Java application. To do this we’ll need to construct an HTTP POST request. In Java it’s not simple to do this so [...]