Re: Why does AffineTransform not work on JTextPane?
"fiziwig" <fiziwig@yahoo.com> wrote in message
news:1155235460.892436.215590@p79g2000cwp.googlegroups.com...
Oliver Wong wrote:
"fiziwig" <fiziwig@yahoo.com> wrote in message
<snip>
OR any ideas for a different way to display STYLED text (font, size,
color, bold, italic on a character-by-character basis) at a 90 or 180
degree rotation. It doesn't have to be editable when rotated, but it
does need to be editable when upright, otherwise I'd just use HTML in a
JLabel.
How about using a JTextPane for editing, and when editing is done,
copy
the contents and put it into a JLabel, and rotate the JLabel?
That might work. The problem is then I have to go through the text
character by character pulling out the attributes (font, size, color,
bold, italic,...) and turning those into HTML tags so that they will
display properly in the JLabel. Then when the user selects the text for
editing again I have to turn around and parse out all the HTML tags and
build it back into a styled document.
Or you could have a central "model" object which semantically preserves
all the information you need in your document, and generate HTML like views
for the Label, and the character-style like view and editor for the
JTextPane.
Another thing you could try is, once the user has finished editing
everything, taking a screen capture of the JTextPane, and then rotating that
image, and displaying it.
- Oliver