•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 391,777 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 3,438 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: 1916 | Replies: 0
![]() |
•
•
Join Date: Jun 2004
Posts: 604
Reputation:
Rep Power: 6
Solved Threads: 6
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
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
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
- edges of print missing when printing web pages (Web Browsers)
- Windows 2000 Adv Server and "Printing Subsystem" (Windows NT / 2000 / XP / 2003)
- Problem printing from IE6 (Web Browsers)
- Mac10.3 Printing Problems (OS X)
- WinXP, RH9, Samba, and Printing (*nix Software)
- Printing pictures (Windows NT / 2000 / XP / 2003)
- Linux printing questions (*nix Hardware Configuration)
Other Threads in the Java Forum
- Previous Thread: need help with java
- Next Thread: using a varible from main method


Linear Mode