| | |
Printing
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2004
Posts: 609
Reputation:
Solved Threads: 8
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
![]() |
Similar Threads
- edges of print missing when printing web pages (Web Browsers)
- Windows 2000 Adv Server and "Printing Subsystem" (Windows NT / 2000 / XP)
- 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)
- 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
Views: 2222 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for Java
android api apple applet application applications arguments array arrays automation bank binary bluetooth chat class classes clear client code codesnippet component database db development dice draw ebook eclipse error event exception file formatingtextintooltipjava fractal game givemetehcodez graphics gui helpwithhomework html ide image infinite input integer invokingapacheantprogrammatically j2me jarfile java javaprojects jmf jni jpanel julia linux list loop map method methods mobile netbeans newbie number object openjavafx oracle parameter print problem program programming project recursion repositories scanner screen scrollbar server set size sms socket sort sorting sql sqlserver state storm string superclass swing swt test text-file threads time transfer tree windows





