Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HOw to wrap a line in JList???  RSS feed

 
Yaroslav Chinskiy
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to put a string on JList. If string is bigger then the JList a Scrolling bar will apper. Instead of using scroll pane I want to wrap the remaing string to the other line within the same cell so once i select the cell, the whole string will be selected.
Thank you.
 
Wilfried LAURENT
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the answer lies in the implementation of a specific cell renderer for a JList. You have to associate a renderer which handles the multi line drawing. You should have a look at the following link which may give you some ideas
http://www.javaworld.com/javaworld/javaqa/2000-03/01-qa-button.html
[This message has been edited by Wilfried LAURENT (edited October 10, 2001).]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!