开发者

Java linux printing question

开发者 https://www.devze.com 2023-02-17 08:38 出处:网络
I have an application that displays JFrame with graphics to be printed. When I run the application from command line, the printing process works fine. However, if this application is invoked by other

I have an application that displays JFrame with graphics to be printed. When I run the application from command line, the printing process works fine. However, if this application is invoked by other application, the printing process does not work and the getGraphics() of the PrintJob class ret开发者_Python百科urns null.

Anyone have any ideas what might be a reason of this beahavior? I use Red Hat Linux.

Thanks in advance.


  • Is it invoked by a service or a process that is not attached to X session ?

I have experimented same issue with Java graphic/print manipulation if the process isn't attached to a graphical desktop session (X Server).

Only solution is to run the process attached to a graphical session, I didn't found any other workaround.

0

精彩评论

暂无评论...
验证码 换一张
取 消