title: Java GUI JScrollPane
body: <p>I am a beginer at programing and i wanted to add a scroll panel to a JTextArea so i tried to research tutorials online. i followed the examples but its not working can someone plz tell me what i am doing wrong. thank you so much</p>
  
  <pre><code>    public View(Model model) {
      this.model = model;
      setBounds(100,50, 800, 400);
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      Container c =  getContentPane();
      addDisplay(c);
      addButtons(c);
      addTxt(c);
  
  }
  
  private void addDisplay(Container c){
      JPanel p = new JPanel();
      addTxt2(p);
      addTxt(p);
      add(p, "North");
  
  }
  
      private void addTxt(JPanel p){
          txt = new JTextArea(15, 35);
          txt.setBackground(Color.BLACK);
          txt.setForeground(Color.WHITE);
          txt.setEditable(true);  
  
          JScrollPane scroll= new JScrollPane (txt);
          p.add(scroll); 
  
  
  }
  </code></pre>