Hi all, I have a standalone Swing application, and I am using Java print APIs to print a JTree. When I am running the program from an executable jar file, print works fine. But, if I use webstart to run the application, for some reason some of the nodes' labels in the tree get truncated. Even though this seems to be a width issue, but some of the longer node labels are getting printed fine, but some of the shorter ones get truncated. Any reason as to why this might happen, and any solutions for the fix? Thanks, Payam.
Joined: Jan 31, 2003
I have posted the following questions on multiple user groups and web sites. But I have not received any responses yet. I was hoping the Authors of the Manning Swing book could help me. I really appreciate any help. Thanks, Payam.
My guess (emphasis on guess is that your the fontwidth is causing the problem. Try modifying your tree cell renderer to calculate the preferred width of each cell differently (not based on current font, which is default JLabel behavior)
Thanks for replying to my message. I do not think font width is the problem, because some lines which are longer are getting printed, but some shorter lines are getting truncated. If all the lines were getting truncated from the same exact place, then font width could be a good candidate. Any other suggestions? Thanks, Payam.