private void calculateBaseUnits() {
// This calculation comes from:
// http://support.microsoft.com/default.aspx?scid=kb;EN-US;125681
FontMetrics metrics = Toolkit.getDefaultToolkit().getFontMetrics(
UIManager.getFont("Button.font"));
baseUnitX = metrics.stringWidth(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
baseUnitX = (baseUnitX / 26 + 1) / 2;
// The -1 comes from experimentation.
baseUnitY = metrics.getAscent() + metrics.getDescent() - 1;
}