Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying a carriage return in a jTable row.

 
Hosh Nasi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a storageDataSet that is being displayed in a GUI through a jTable. The columns are being manipulated by row through a DataRow object. One particular column is a string that is concatinated from many other stings and each string ends in '\n'. How can I get this to be displayed? Right now the returns are just ignored, and all is lumped together.

Thanks!
[ January 27, 2005: Message edited by: Hosh Nasi ]
 
Hosh Nasi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about that. I am using jTable not the borland implemenation.. Does anyone have any ideas on this one? I heard a CellRenderer might be useful. Anyone have a good link on how to use them?

Thanks!
 
Vlado Zajac
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use html in Swing components.

will be displayed in two lines.
 
Hosh Nasi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very interesting. So if I user the br to to break the row will this display in my JTable?

thanks,

::EDIT:: I mean display within my JTable that is on my Gui.
[ January 30, 2005: Message edited by: Hosh Nasi ]
 
Hosh Nasi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vlado Zajac:
You can use html in Swing components.

will be displayed in two lines.


I tried to test this is many ways. No luck however, now all I see is the my tags <HTML><BR></HTML> when I expect a new line.

thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic