Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Invisible lines in JEditorPane  RSS feed

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a relatively simple Swing app that runs a database query and pumps formatted results into a JEditorPane called report. When I moved to JDK 5 some of the lines disappeared from the output. There is still vertical space for them, and when I select all, copy and paste into a text editor they're all there. I just can't see them.

Here's the line of code that does the deed:
[code]
report.getDocument().insertString( report.getDocument().getLength(), aLine, attr );
[/attr]
Each line starts with a newline. The attributes all have font family "monospaced" and one of three or four colors. I added debugging displays of the color right before writing and there may be three lines in a row with the same color and the middle one does not appear.

Any thoughts on what might be going on?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I'll be dipped. I set the editor pane up like this:

I never closed the pre tag. Maybe that confused something, or maybe mixing pre with attributes. I just took the pre tag out of there and it's all happy now.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!