I want to make a button which will print a page using the printer, so when the user press it certain page will be printd

This will print the Content in TextArea...

    PrinterJob job= PrinterJob.getPrinterJob();
    if(job.printDialog()){
        try {

            job.setPrintable(area.getPrintable(null,null));
            job.print();
        }catch(Exception e) {
            JOptionPane.showMessageDialog(this,"Error While Printing"+e);
        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.