944,028 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 2319
  • Java RSS
Nov 27th, 2004
0

Printing

Expand Post »
Hi everyone,

I am currently trying to print even or odd pages only.
I have a frame which contains a jtextpane with some text in it that spans about ten pages and it also contains two buttons. One button if clicked prints out only even pages and the other button when clicked only prints odd pages. The thing is the program does not seem to work. I am using the printable interfce by the way.

I tried testing the pageIndex variable of the overided print function of the printable interface
as follows:

if(pageIndex%2 == 0)
{
print even
}

else
{
print even
}

The thing is that only the first page is being printed no matter how many pages i have whether i am printing even or odd pages only.

Can someone show me the correct way of printing even or odd pages using the printable interface the right way.

If it is of no inconvinience i hope someone can show a simple example of printing even or odd pages using the printable interface

Any help is greatly appreciated

Thank You

Your Sincerely

Richard West
Similar Threads
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: need help with java
Next Thread in Java Forum Timeline: using a varible from main method





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC