0

I want to do this because I want to print a Swing component on client side printJob.print(); always print on server side. Is there any other way to do so?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433

1 Answers1

1

Since browser manufacturers removed support for applets and Java Web Start, and they were deprecated by Oracle, there is really no way to display Java GUI components on the client side from within a web-app.

An alternative might be to generate an image of the component on the server side and send that image to the client. On the other hand, there is little that can be rendered in a Swing component that can't be rendered in pure HTML, so I doubt that Swing components are even necessary.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • what could be the possible way to generate an image of the component on the server side..? any link or tutorial ? – Aditya Sarraf Feb 04 '18 at 05:46
  • 1) See for example [`ComponentImageCapture` or `LabelRenderTest`](https://stackoverflow.com/questions/5853879/swing-obtain-image-of-jframe/5853992#5853992). 2) Words typed in all lower case are hard to read, like trying to listen to someone who is mumbling. Please use an upper case letter at the start of sentences, for the word I, and proper names like `ArrayList` or Oracle. – Andrew Thompson Feb 04 '18 at 06:47
  • Done... Thanks... – Aditya Sarraf Feb 05 '18 at 05:48