title: Removing a Frame's title bar keeping the resize mechanims - Java
body: <p>My problem is related with what Jonas asked on the next topics:</p>
  
  <p><a href="https://stackoverflow.com/questions/2780780/how-to-add-support-for-resizing-when-using-an-undecorated-jframe">How to add support for resizing when using an undecorated JFrame?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/2781987/how-can-i-customize-the-title-bar-on-jframe">How can I customize the title bar on JFrame?</a></p>
  
  <p>I want to create a custom window without the native title bar. This can be done by calling:</p>
  
  <pre><code>setUndecorated(true);
  </code></pre>
  
  <p>However, this also removes the re-size mechanism. So now I am using the next code:</p>
  
  <pre><code> public UndecoratedFrame() {
   this.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
      menu.add(item);
      menuBar.add(menu);
      this.setJMenuBar(menuBar);
      this.setUndecorated(true);
      this.getRootPane().setBorder(border);
      this.setSize(400,340);
      this.setVisible(true);
  }
  </code></pre>
  
  <p>This returns a window like this:
  <a href="http://www.roseindia.net/java/example/java/swing/CreateJList.shtml" rel="nofollow noreferrer">http://www.roseindia.net/java/example/java/swing/CreateJList.shtml</a>
  (Consider only the title bar and borders)</p>
  
  <p>How can I remove the top title bar without removing the re-size decorator? Or should I customize the default title bar? How can I do this by a simple way?</p>
  
  <p>The idea is to end with a frame only with its borders (and the re-size working..). Then, I can create a custom title bar with a JPanel and buttons triggering the close, minimization, etc. OS events.</p>
  
  <p>Thanks in advance for your support.</p>