title: How to move undecorated JFrame by holding click on a JPanel in Java?
body: <p>I've been making an undecorated JFrame so far and I was wondering if it's possible to move the undecorated JFrame by holding click on a JPanel.</p>
  
  <p>Here is the source code I'm working on.</p>
  
  <pre><code>private static void createFrame()
  {
      JFrame frame = new JFrame("Text Frame");
      frame.setLayout(null);
      frame.setSize(500,300);
      frame.setUndecorated(true);
  
      JPanel panel = new JPanel();
      panel.setBounds(0, 2, 500, 50);
      panel.setBackground(new Color(60, 65, 70));
      frame.add(panel);
  
      frame.setVisible(true);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
  }
  </code></pre>
  
  <p>What I want to do is: 
  Click and hold my cursor at the JPanel area to be able to move the JFrame.</p>
  
  <p>I did some research and came across to a similar question: <a href="https://stackoverflow.com/questions/10773713/moving-undecorated-window-by-clicking-on-jpanel">Moving undecorated window by clicking on JPanel</a></p>
  
  <p>I don't understand how to integrate the code provided (by user Sorter) on my code.</p>
  
  <p>Or are there another solutions?</p>