The print is pixelated when printing a JTable

Discuss here any questions about the WebLaF library.
Bugs can be posted directly to GitHub issues tracker.

The print is pixelated when printing a JTable

Postby archlire » Fri May 01, 2015 8:36 pm

Well uh yes, title says it all..
It's pixelated when I use webLAF.
Here's a comparison with the default LAF

Image
archlire
 
Posts: 2
Joined: Sun Mar 16, 2014 5:05 pm

Re: The print is pixelated when printing a JTable

Postby archlire » Mon May 04, 2015 9:01 am

just found out that JTable.print() does not work well with custom LAF so I just had to make another Table only for printing....
archlire
 
Posts: 2
Joined: Sun Mar 16, 2014 5:05 pm

Re: The print is pixelated when printing a JTable

Postby mgarin » Mon May 11, 2015 5:38 pm

I am afraid Swing overall is not the best tool to print something, even if it generally allows you to.

Default L&F might look a bit better in printed form due to different fonts used and less graphical details. Basically when printing occurs the whole UI element you are printing is scaled to the page size and that might look just ugly in some cases. Swing UI is generally pixel-based and uses images to create the final UI view and render it onto the screen, so when you are printing it some optimizations may be done due to the flag set but it will still look pretty bad.

A good way to print tables like that is to create some PDF or DOC based on that table and print it instead of the UI element. Though this solution have other issues and might not be the best one for all cases.

So I'm not really sure how I can help you with this case.
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg


Return to Questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron