1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
public class GestionImprimer implements ActionListener /**Evènement du sous-item 'internet'**/
{
public Page3 page;
private PageFormat pageFormat;
private Graphics g;
private int pageIndex;
private Printable page3;
GestionImprimer (Page3 page)
{
this.page = page;
}
/**
* Methode pour lancer L'impression
* @param e ActionEvent
// */
public void actionPerformed(ActionEvent ev) {
Variable.out.println("4");
PrinterJob printJob = PrinterJob.getPrinterJob();
Variable.out.println("5");
if (pageFormat == null) pageFormat = printJob.defaultPage();
Variable.out.println("6");
printJob.setPrintable(page, pageFormat);
Variable.out.println("7");
if (printJob.printDialog()){ // le dialogue dimpression
try{
Variable.out.println("8");
printJob.print();
Variable.out.println("9");
}catch (PrinterException exception){
}
} |