• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing multiple pages for the JTree  RSS feed

 
Archana Venu Aradhyula
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I use a JTree which is loaded dynamically into the application.
Now i need to print the entire tree structure. That part also i have done it is working fine but it is printing only the first page.
My code is shown below.



How do i achieve printing in multiple pages. I think i need to calculate the number of pages first. Am i doing anything wrong.

Thanks
Archana
 
Rob Spoor
Sheriff
Posts: 20892
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you need to calculate the number of pages.

In pseudo code:

So that leaves three gaps you need to fill in.
 
Archana Venu Aradhyula
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Thanks for your idea.
But how to calculate the number of pages for the tree that is loaded dynamically.

Thanks
Archana
 
Archana Venu Aradhyula
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

How do we get


Thanks
Archana
 
Rob Spoor
Sheriff
Posts: 20892
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know the size of the tree?
Do you know the size of the page?

Then the number of vertical pages is the tree height divided by the page height, and likewise for horizontally.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just another cross poster.
http://forums.sun.com/thread.jspa?threadID=5355538
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!