Dear All,
I have a problem with a code i am developing. I am trying to print the
result of a JList to a printer. I followed the example in the java
cookBook using CommAPI but when i try to print, i get the following
exception "port currently owned by unknown windows application". Can
anybody help by telling me how to solve this problem or how to go
around it. I have put a listener and set the waiting time to 30000sec
even at that, i never get the ownership of the port.
regards,
Noah.
JScoobyCed - 29 Mar 2006 07:56 GMT
> Dear All,
>
[quoted text clipped - 8 lines]
> regards,
> Noah.
I guess the windows driver is having the owership of the printer. Try
deleting the printer from your list of windows printers.

Signature
JSC
tolu45 - 29 Mar 2006 08:08 GMT
I am not sure if you are talking about the physical printer. If you
are, i can't delete it because i have only one network printer
installed.If i delete it how do i print?. If you are talking about the
software i create a new instance each time i want to print.
Thanks
Thomas Weidenfeller - 29 Mar 2006 13:37 GMT
> I have a problem with a code i am developing. I am trying to print the
> result of a JList to a printer. I followed the example in the java
> cookBook using CommAPI
How does that match with your later statement:
>>> i can't delete it because i have only one network printer
>>> installed.If i delete it how do i print?
You either have a physically connected printer, then JavaComm (you are
talking about JavaComm when you say CommAPI?) is a way to print to it
(but possibly the worst one can come up with), or you have a remote
printer. In the later case, JavaComm has no way to reach it at all.
You probably want to have a look at the real printing APIs in Java
instead of messing with JavaComm.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
Roedy Green - 29 Mar 2006 20:42 GMT
>I have a problem with a code i am developing. I am trying to print the
>result of a JList to a printer. I followed the example in the java
[quoted text clipped - 3 lines]
>around it. I have put a listener and set the waiting time to 30000sec
>even at that, i never get the ownership of the port.
That is not the way you would normally print, unless you were using
some specialised printer not supported by the OS. See
http://mindprod.com/jgloss/printing.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.