title: Is it possible to set the underline offset when using Font.UNDERLINED?
body: <p>Is it possible to set the underline offset when using <strong>Font.UNDERLINED</strong>? I am using the following to make the font underlined:</p>
  
  <pre><code>LabelField lf = new LabelField("Forgot your password?");
  lf.setFont(Font.getDefault().derive(Font.BOLD | Font.UNDERLINED));
  </code></pre>
  
  <p>The above code produces</p>
  
  <p><img src="https://i.stack.imgur.com/xminO.png" alt="enter image description here"></p>
  
  <p>I want the underline to appear at the font's bottommost position. Like this:</p>
  
  <p><img src="https://i.stack.imgur.com/8B5gZ.png" alt="enter image description here"></p>
  
  <p>Solutions I can think of:</p>
  
  <ol>
  <li><p>One possible solution would be to extend <code>LabelField</code> and override its <code>paint()</code> method. Something in the form:</p>
  
  <pre><code>paint(Graphics g) {
      super.paint(g);
      g.drawLine(...);
  }
  </code></pre>
  
  <p>The above code will work fine as long as <code>LabelField</code>'s contents will occupy a single line.    It will become very messy once the contents will occupy multiple lines. Therefore, I am looking for a more appropriate solution.</p></li>
  <li><p>Another solution would be to write a new field similar to <code>LabelField</code> from scratch.</p></li>
  </ol>