खोज…


मूल मुद्रण

PrinterJob pJ = PrinterJob.createPrinterJob();

if (pJ != null) {
    boolean success = pJ.printPage(some-node);
    if (success) {
        pJ.endJob();
    }
}

यह उपयोगकर्ता को कोई संवाद दिखाए बिना डिफ़ॉल्ट प्रिंटर पर प्रिंट करता है। डिफ़ॉल्ट के अलावा किसी अन्य प्रिंटर का उपयोग करने के लिए आप वर्तमान प्रिंटर सेट करने के लिए PrinterJob#createPrinterJob(Printer) का उपयोग कर सकते हैं। आप अपने सिस्टम पर सभी प्रिंटर देखने के लिए इसका उपयोग कर सकते हैं:

System.out.println(Printer.getAllPrinters());

सिस्टम संवाद के साथ मुद्रण

PrinterJob pJ = PrinterJob.createPrinterJob();

if (pJ != null) {
    boolean success = pJ.showPrintDialog(primaryStage);// this is the important line
    if (success) {
        pJ.endJob();
    }
}


Modified text is an extract of the original Stack Overflow Documentation
के तहत लाइसेंस प्राप्त है CC BY-SA 3.0
से संबद्ध नहीं है Stack Overflow