• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

print JTree !

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to i print JTree with all node opened?
Have solution to convert node to text?
Thanks a lot, i searched on google so i am not see.
[ November 14, 2007: Message edited by: Tran Tuan Hung ]
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
let's slide this over to the intermediate forum...
 
Tran Tuan Hung
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An helper give me a method following:
But i still not work.
Plesae help me:

I have created a main method and i call it, but it's still not work.
Plesae help me to correct it.
Best regards,
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does that method do, and how does it not work?
 
Tran Tuan Hung
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That method is to print JTree multiple page, I dont know to use it, so i create a main method and call that method, but it error.
Here is full class:


Here is error, how to correct the code, thanks you very much.
I am needing it.

Exception in thread "main" java.lang.NullPointerException
at print.PrintHelper.print(PrintHelper.java:23)
at print.PrintHelper.main(PrintHelper.java:48)

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The error message is telling you that there is an object in line 23 that is null, and which you are trying to dereference. So, look into line 23, and check whether any of the objects dereferenced in it are null. (Hint: there is only one object, and it is null).
 
Tran Tuan Hung
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks you very much, i have successed for printing, but for now i have a problem:
because use JTable, so when i print my Tree, so it appear a boder (i dont like the boder, i would like it disapper), please help

me. Thanks you verey very much.
best regards,
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about calling "setBorder(new EmptyBorder())"?
 
Tran Tuan Hung
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I set the border as following:

or

But it still have the border.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic