typo
added methods for calculating label dimensions
moved DOM element construction from paint method to Java constructors