how to use a swing component for printing its contents.For example, a JTable. I just need to pring its content, andnothing else in the UI.which command to use ? A sample code will be gratefully received.
You will have to call table.print() without parameter.see the code below:try { boolean complete = table.print(); if (complete) { /* show a success message */ ... } else { /*show a message indicating that printing was cancelled */ ... }} catch (PrinterException pe) { /* Printing failed, report to the user */ ...}