I have a small doubt. Please tell me

My JTextfield is not visible inside my frame

which is inside a desktop frame..

Plz tell me why.

{

JDesktopPane dskk =new JDesktopPane();;

Container c11=getContentPane();

c11.add(dskk);

JTextArea txa =new JTextArea();

txa.setText(str);

JScrollPane scp=new JScrollPane();

scp.add(txa);

txa.setVisible(true);

scp.setVisible(true);

JInternalFrame inf2 =new JInternalFrame("Internal Frame",true,true,true,true);

inf2.setSize(350,350);

Container con2=inf2.getContentPane();

con2.add(scp);

inf2.setOpaque(false);

dskk.add(inf2);

inf2.setVisible(true);

setSize(400,400);

setVisible(true);

}

[1134 byte] By [qazwsx_qaza] at [2007-10-3 5:21:43]
# 1
scp.add(txa); is wrongeitherJScrollPane scp=new JScrollPane(txa);orscp.setViewportView(txa);if it still doesn't show, gixe the textArea some rows/columns (10,10)JTextArea txa = new JTextArea(10,10);
Michael_Dunna at 2007-7-14 23:28:41 > top of Java-index,Desktop,Core GUI APIs...
# 2
Oh.. thank you verryyyyyyyyyy much.
qazwsx_qaza at 2007-7-14 23:28:41 > top of Java-index,Desktop,Core GUI APIs...