@Override
  public void paint(final Graphics g) {
    super.paint(g);

    final Border border = getBorder();

    int realLeft = 0;
    int realWidth = getWidth();

    if (border != null) {
      final Insets insets = border.getBorderInsets(this);

      realWidth -= insets.right;
      realWidth -= insets.left;
      realLeft += insets.left;
    }

    g.drawLine(realLeft, getHeight() - 2, realWidth, getHeight() - 2);
  }
Label class that can be used to launch URLs from Java.

<p>Taken from http://forum.java.sun.com/thread.jspa?threadID=613854&messageID=9959263
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/UrlLabel/UrlLabel.java