hi,
Thank you for the reply~it does help~~
But here comes a new problem:
Here are the code I copied from the official example:
Rectangle alloc = getVisibleEditorRect(ta);
ta.getUI().getRootView(ta).paint(g2,alloc);
protected Rectangle getVisibleEditorRect(JTextPane ta) {
Rectangle alloc =ta.getBounds();
if ((alloc.width > 0) && (alloc.height >
0)) {
alloc.x = alloc.y = 0;
Insets insets =
ta.getInsets();
alloc.x += insets.left;
alloc.y += insets.top;
alloc.width -=
insets.left + insets.right;
alloc.height -=
insets.top + insets.bottom;
return alloc;
}
return null;
}
Firstly, for this line:
ta.getUI().getRootView(ta).paint(g2, alloc);
I was suggested to change this line into:
ta.getUI().getRootView(ta).paint(g2, (Shape) alloc);
Secondly, netbeans report en error for this line:
Rectangle alloc =ta.getBounds();
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Uncompilable
source code
REQUIRED:com.lowagie.text.Rectangle
FIND: java.awt.Rectangle
I think I just messed up with the two rectangles:
java.awt.Rectangle and com.lowagie.text.Rectangle
Well, I am totally messed up now and dont know how to fix it. :..(
Any help is appreciated~~~
Thanks a lot in advance~~~
----- 原始邮件 -----
发件人:1T3XT BVBA <[email protected]>
收件人:[email protected]
主题:Re: [iText-questions] Re:Re:_回复:Re:__save_all_objects_in_JTextpane_in_one_go
日期:2011-4-5 19:09:57
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php