Forums Register Login

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

+Pie Number of slices to send: Send
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
mooooooo ..... tiny ad ....
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1035 times.
Similar Threads
printing in java 1.4
Tab Stops
Formatting for JTextPane
Tab Stops
HTML text on SWING components
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:03:13.