title: Problem with changing the location of TextArea in JFrame when I have JScrollPane
body: <p>My code brings text area on the left top corner of the frame. How can I change the location in the frame? <a href="https://i.stack.imgur.com/KlZoQ.png" rel="nofollow noreferrer">IMAGE</a></p>
  
  <pre><code>        JFrame frame = new JFrame("JSP");
          JTextArea textArea = new JTextArea();
          JScrollPane scroll = new JScrollPane(textArea);
          scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
          scroll.setSize( 100, 200 );
          scroll.getViewport().setViewPosition(new java.awt.Point(100, 50));
          frame.add(scroll);
          frame.setSize(250, 300);
          frame.setLayout(new BorderLayout());
          frame.setVisible(true);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setLocationRelativeTo(null);
  </code></pre>