Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextPane in JList?  RSS feed

 
Dean Watson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to populate a JList Item with underlined text. I was successful in creating style documents and puting them in a single text pane. But when I attempt to create an array of text panes and put them in the JList, it prints the name of the class, not the styled text I populated it with.
Any Ideas?
Dean
 
Ashwin Desai
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think that you might have to set the Rendering component for the List using JList.setRenderingComponent(ListRenderingComponent ) method. You can refer to
http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html#renderer
for more details.
Ashwin.
[This message has been edited by Ashwin Desai (edited May 15, 2001).]
 
Dean Watson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tip. Would you know how to extract the underlined text from the JTestPane for the setText method?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!