PrinterMakeAndModel always returns null with Windows XP

S

Stefan Cordes

I tried to find the informations standing in Windows XP "Start"
"Settings"
"Printers and Faxes" using pure Java:
Object tempObject;
Class tempInfoClass;
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(OrientationRequested.LANDSCAPE);
aset.add(MediaSizeName.ISO_A4);

PrintService[] tempPrintServices =
PrintServiceLookup.lookupPrintServices(DocFlavor.SERVICE_FORMATTED.PAGEABLE,
aset);
for (int i = 0; i < tempPrintServices.length; i++) {
System.out.println();
System.out.println("Printer: " + tempPrintServices.getName());

tempInfoClass = PrinterMakeAndModel.class;
tempObject = tempPrintServices.getAttribute(tempInfoClass);
System.out.println(tempInfoClass + ": " + tempObject);
}

But tempObject always returns null.

Related Bug:
http://developer.java.sun.com/developer/bugParade/bugs/4673400.html
Reported Against: 1.4
Release Fixed :
State: In progress, request for enhancement

Does anybody have a workaround?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top