Einzelnen Beitrag anzeigen
Alt 18.02.2006, 13:54   #8 (permalink)
tobsen
Overclocker
 
Benutzerbild von tobsen
 

Registriert seit: 09.07.2005
Beiträge: 233

tobsen sorgt für eine eindrucksvolle Atmosphäretobsen sorgt für eine eindrucksvolle Atmosphäre

Standard AW: drucken eines textes in java

Hm, hab das Problem gefunden, aber nicht gelöst :

Es heißt ja:
Code:
PrintService[] pservices =
		 				 PrintServiceLookup.lookupPrintServices(flavor, aset);
			 		 if (pservices.length > 0) {
Wenn ich mir dann mal pservices.length ausgeben lasse:
Code:
System.out.println(pservices.length);
dann ist das Ergebnis 0.
Tja klar dass er dann nicht anfängt zu drucken. Dann wollen wir mal schaun wie sich das Prob lösen lässt.

Achja, in der API steht dazu folgendes:
Code:
  lookupPrintServices

  public static final PrintService[] lookupPrintServices(DocFlavor flavor,
                                                       AttributeSet attributes)   Locates print services capable of printing the specified  DocFlavor.  

Parameters:
  • flavor - the flavor to print. If null, this constraint is not used.
  • attributes - attributes that the print service must support. If null this constraint is not used.
Returns: array of matching PrintService objects representing print services that support the specified flavor attributes. If no services match, the array is zero-length.
tobsen ist offline   Mit Zitat antworten