Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to print from a JTextPane (or maybe from a DefaultStyledDocument)  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Here is the deal:

I have a JTextPane with a logo (jpg) and Text.
how can I print all the information taken from the JTextPane.


my code looks like this:

protected JTextPane pane;
protected DefaultStyledDocument doc;
.
.
.
this.doc = new DefaultStyledDocument();
this.pane = new JTextPane(doc);
.
.
.
StyleConstants.setFontSize(attr, 12);
StyleConstants.setForeground(attr, Color.BLACK);
doc.insertString(doc.getLength(), "text comes here", attr);


Thanks for any help
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!