title: change TitledBorder color dynamically in java
body: <p>I have created a TitledBorder and set it to a JPanel.</p>
  
  <pre><code>JPanel panel = new JPanel();
  panel.setBorder(javax.swing.BorderFactory.
        createTitledBorder(null, "title", javax.swing.border.
        TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.
        TitledBorder.DEFAULT_POSITION, null, java.awt.Color.red));
  </code></pre>
  
  <p>now I want to change the color of the title text of the border; and if possible border lines. I see when I change color of the border by the method <code>titledborder.setTitleColor(theColor);</code> and <code>revalidate()</code> and <code>repaint()</code>; the panel on form is not affected. I also created new instance of <code>thiledBorder</code> and assign it to the panel; but not effective. Is it necessary to renew the panel, and then set it new a border instance? thank you</p>