Win a copy of Kotlin in Action this week in the Kotlin 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
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!