User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 397,646 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,382 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1756 | Replies: 3
Reply
Join Date: Jun 2004
Posts: 604
Reputation: freesoft_2000 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Help Inserting Page Numbers

  #1  
Nov 24th, 2004
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,660
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 192
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Inserting Page Numbers

  #2  
Nov 24th, 2004
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.
Reply With Quote  
Join Date: Jun 2004
Posts: 604
Reputation: freesoft_2000 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: Inserting Page Numbers

  #3  
Nov 25th, 2004
hi everyone,
Yes you are right but how will you go about doing this

Richard West
Reply With Quote  
Join Date: Jun 2004
Posts: 604
Reputation: freesoft_2000 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: Inserting Page Numbers

  #4  
Nov 25th, 2004
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Java Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 11:07 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC