0

Hi everyone,

I have a jtextpane with some text which spans to about 10 pages and what i want to able to insert page numbers into the center bottom of the page. I am using the DefaultStyledDocument class as the default document type for my jtextpane.

I hope someone can explain to me or show me some codings that can help me to insert the page numbers into the jtextpane

Thank You

Yours Sincerely

Richard West

2
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by freesoft_2000
0

You don't want the page numbers inserted into the text editor.
What will happen if you add or remove text? The numbers will now no longer be properly positioned, instead showing in the middle of the pages.

Instead you'd better customise your printing routine (I guess you want to print things?) to insert page numbers every X lines and a pagebreak directly after that.

0

Hi everyone,

I managed to do it thanks to you pointing me to the right direction
jwenting

Any way here is what i added in

g.drawString(("Page " + (pageIndex + 1)), 225, 645);

Thank You

Richard West

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.