@Override
   public void paintComponent(Graphics context) {
      Graphics2D context2d = (Graphics2D) context;
      if (getText() == null) {
         super.paintComponent(context);
      } else {
         if (antialiase) {
            context2d.setRenderingHint(
                    RenderingHints.KEY_TEXT_ANTIALIASING,
                    RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
         }
         context2d.setFont(getFont());
         FontMetrics metrics = getFontMetrics(getFont());
         int textWidth = metrics.stringWidth(getText());

         int x = 0;
         if (getHorizontalAlignment() == CENTER) {
            x = (getWidth() / 2) - (textWidth / 2);
         } else if (getHorizontalAlignment() == RIGHT) {
            x = getWidth() - textWidth;
         }
         // This seems to be the standard JLabel placement, odd...
         int y = (getHeight() / 2) + (metrics.getAscent() / 3);

         if (shadowColor != null) {
            context2d.setColor(shadowColor);
            context2d.drawString(getText(), x + shadowX, y + shadowY);
         }
         context2d.setColor(getForeground());
         context2d.drawString(getText(), x, y);
      }
   }