• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiline in JList

 
Anusha Jv
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to render multiline data in each cell of the JList.
How can this be done.
I made use of JLabel rendered in the List by automatic wrapping does not take place.The List is in a scrollpane and this frame is resizable.
 
Wilfried LAURENT
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try with html tags
< p >
or < br >
when you want to add a carriage return. This may be enough. Otherwise, you will have to define your own cell renderer for the list.
W.
[This message has been edited by Wilfried LAURENT (edited October 11, 2001).]
 
Anusha Jv
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used a JLabel with HTML tag. in the List.
But wrapping does not take place.
It is not possible to insert BR tag inbetween as the datas are dynamic from database.
When a label is used seperately wrapping works well but it does not work in the List.However if setPreferredSize is used for label then wrapping takes place but this is also not possible to set the size.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!