Problema com o XYLayout do JDeveloper

Pessoal,

Sou novato em Java e estou apanhando pra caramba com os gerenciadores de laioute…, então, preciso exibir um jTextArea com um JScrollPane, entao tentei o seguinte codigo:

(Se eu tirar a linha:)

this.getContentPane().add(new JScrollPane(jTextArea1),new XYConstraints(250,120,20,20));

(Aparece a jText legal, porém se eu colocar o scroll zua tudo)…

Alguem poderia me dar umas dicas??

Segue o Código…:

package principal;

import javax.swing.JFrame;
import java.awt.Dimension;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import oracle.jdeveloper.layout.BoxLayout2;
import javax.swing.JLabel;
import java.awt.Font;
import oracle.jdeveloper.layout.XYLayout;
import oracle.jdeveloper.layout.XYConstraints;
import javax.swing.JList;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;

public class FrameDatabases extends JFrame 
{
  private XYLayout xYLayout1 = new XYLayout();
  private JTextArea jTextArea1 = new JTextArea();

  public FrameDatabases()
  {
    try
    {
      jbInit();
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }

  }

  private void jbInit() throws Exception
  {
    this.getContentPane().setLayout(xYLayout1);
    this.setSize(new Dimension(537, 366));
    jTextArea1.setText("jTextArea1");
    
    this.getContentPane().add(jTextArea1, new XYConstraints(25, 120, 265, 180));
    this.getContentPane().add(new JScrollPane(jTextArea1),new XYConstraints(250,120,20,20));
  }
}

Abração pessoal do GUJ (Vcs são feras…)

Mateus.

[color=red]Mensagem do moderador: Ao colocar codigos favor utilizar as tags [ code ] [ /code ] [/color]

Use as tags code para postar seu código.

porque isso

this.getContentPane().add(jTextArea1, new XYConstraints(25, 120, 265, 180)); 
this.getContentPane().add(new JScrollPane(jTextArea1),new XYConstraints(250,120,20,20));

não seria somente o scrollPane que vc deveria adicionar no ContentPane, uma vez que, o scrollPane tem um textArea