title: How do I underline text "text" when text is a field?
body: <pre><code>public class Text extends JPanel {
  
  private String text;
  
  
      public Text()
      {
      this.setPreferredSize(new Dimension(20,20));
      setFont (new Font(text, Font.PLAIN, 24));
      text = "";
      }
  
      public void showUnderline()
      {
  
      Hashtable&lt;TextAttribute, Object&gt; map = new Hashtable
      &lt;TextAttribute, Object&gt;();
  
      map.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);   
      }
  </code></pre>
  
  <p>the text object will be created within another class. in that class I will need to underline it with the showUnderline method. The method seems incomplete.<br>I'm shooting for the java exclusive approach, meaning no HTML.<br>
  How do I link the text to the showUnderline method? </p>