JTable Containing JTextArea
Hallo,
i am generating a JTable in my UI:
Code:
for(int i=0;i<topics.size();i++){
postTextArea.setText(topics.getContent());
Object[] tmp = {topics.getUsername(),postTextArea, "options"};
tabModel.addRow(tmp);
}
add(table, "cell 1 2,grow");
What i want: the JTextArea containing the specific text is being displayed in this table.
What happens: at the points in the table, where the JTextArea should be displayed, there are information like
"javax.swing.JTextArea[,0,0,0x0,invalid,layout=javax.swing.plaf.basic.Bas icTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0 .0,border=javax.swing.plaf.basic.BasicBorders$Marg inBorder@8dcd5d,flags=296,maximumSize=,minimumSize =,preferredSize=,caretColor=sun.swing.PrintColorUI Resource[r=51,g=51,b=51],disabledTextColor=javax.swing.plaf.ColorUIResourc e[r=184,g=207,b=229],editable=true,margin=javax.swing.plaf.InsetsUIRes ource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],colums=0,columWidth=0,rows=0,rowHeight=0,word=fal se,wrap=false]"
I dont want the Informatin, i want the JTextArea to be displayed. What am i doing wrong? How can i fix this?