title: JInternalFrame acts weird when windows theme changed?
body: <p>This is my sample code. I am trying to embed a <code>JInternalFrame</code> without titlebar display into a <code>JFrame</code>.</p>
  
  <pre><code>import javax.swing.*;
  import javax.swing.plaf.basic.BasicInternalFrameUI;
  
  class A{
  
  public void doThis(){
      JFrame fr = new JFrame();
      fr.setSize(300,300);
      JInternalFrame f = new JInternalFrame();
      f.setSize(200,200);
      BasicInternalFrameUI ui = (BasicInternalFrameUI) f.getUI();
      ui.setNorthPane(null);
      f.setVisible(true);
      fr.add(f);
      fr.setVisible(true);
      }
  }
  
  class MainA{
  
   public static void main(String a[]){
      A obj = new A();
      obj.doThis();
   }
  }
  </code></pre>
  
  <p>The code works fine and displays a <code>JInternalFrame</code> within a <code>JFrame</code> without titlebar as per the requirement as shown below. </p>
  
  <p><img src="https://i.stack.imgur.com/G5P19.jpg" alt="Before Theme Change"></p>
  
  <p>I still have this UI running and at the same time when I try to change my XP theme (via Properties>>Appearance>>Theme), the UI automatically repaints itself to show the <code>JInternalFrame</code> with a titlebar again as shown below.</p>
  
  <p><img src="https://i.stack.imgur.com/wzAqk.jpg" alt="After Theme Change"></p>
  
  <p>I just can't understand this bizarre behavior. I have no clue if this is an issue with Java Swing or if it is something related to the OS. Please help me with this! </p>
  
  <p>Why is the UI repainting upon theme change with an enabled titlebar when I explicitly code for the titleBar to be set as null?</p>
  
  <p>PS: OS used is Windows XP and I am not sure if the same behavior is observed in Linux or other versions of Windows</p>