title: Showing JFrame in realtime as it changes
body: <p>So what I would like to accomplish is create two JFrames. One will cover the whole screen and when a user clicks on that screen a new JFrame shows up when the user clicks and drags the mouse. Where the user first clicks is the top left corner of the new JFrame and where the user releases the mouse is the bottom right corner of the JFrame. I have no problem making the two JFrames and making the second JFrame show up when the mouse is clicked and released. What the problem is I want the new JFrame to show in realtime when the user is moving the mouse around so before the mouse is released. I tried</p>
  
  <pre><code>public void mouseDragged(MouseEvent e) {
  
              FrontWindow f = new FrontWindow();
  
              while (true) {          
                  f.setBounds(Shared.xPressed, Shared.yPressed, (Utils.getXPosition() - Shared.xPressed) , (Utils.getYPosition() - Shared.yPressed));
                  f.setVisible(true);
              }
  
          }
  </code></pre>
  
  <p>But that didn't work.</p>