title: Drag and Resize undecorated JFrame
body: <p>Currently, I am using the following code to drag and move my undecordated JFrames.</p>
  
  <pre><code>private void initialiseGUI(Component component){
      //&lt;editor-fold defaultstate="collapsed" desc="code"&gt;
      component.addMouseListener(new MouseAdapter() {
          public void mousePressed(MouseEvent e) {
              posX = e.getX();
              posY = e.getY();
          }
      });
  
      component.addMouseMotionListener(new MouseAdapter() {
          public void mouseDragged(MouseEvent evt) {
              //sets frame position when mouse dragged            
              Rectangle rectangle = getBounds();
              getGUI().setBounds(evt.getXOnScreen() - posX, evt.getYOnScreen() - posY, rectangle.width, rectangle.height);
          }
      });
      //&lt;/editor-fold&gt;
  }
  </code></pre>
  
  <p>What must I write so that the user can resize it like a decorated window, by dragging the side?</p>