Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Get the text marking right in JTextPane?  RSS feed

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey!

I Creates a Styled document, and marks some words. Every line is ended with a \n.

To add my text to the styleddocument i use
Styleddocument.insertString(this.getLength(), " " + pt.getStr(),
this.getStyle("" + pt.getCol()));

The a add this Styled dokument to the JTextPane by
MyJTextPane.setStyledDocument(Styleddoc);

There will be colors, but the problem is that it is not coloring all the way out on the right side? and if i mark the text by drag the mouse pointer over and puch the button to select som text it will be selected, but that part of the text on the right side that was not colored is not visible at all?

Maby not to god explanation, but plesa try to help me on this one, this is my 3d try to display text repetly.

//SnowJim
 
Jimmy Nilsson
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A note: this problem only accure on Solaris, in Windows it works fine.

//SnowJim
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just do it yourself?^_※!
 
Jimmy Nilsson
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey!

I have tryed to print out the text manual as you say by using Graphics.drawString(TEXT)

But this takes alot of preformance, the JText Pane most have some special algorithms to show the text, problely not .drawString (or .drawtext?)

or is there anything i am missing?

I have also tryed to draw the content to a bitmap file and then show this bitmap file, but then i have to devide the pages so i dont get BIG bitmaps.

Pleas any sugestions at all?

//Jimmy
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!