Stamp dando in pasto ad un printerjob questo codice:
__________
package print;
import java.awt.*;
import java.awt.print.*;
import javax.swing.AbstractAction;
import modello.BeanOpzione;
public class DistintaPanelPrinter implements Printable {
javax.swing.JTable toPrint = null;
public DistintaPanelPrinter(javax.swing.JTable toPrint) {
this.toPrint = toPrint;
}
public int print(Graphics g, PageFormat pageFormat, int pageIndex) {
if(pageIndex > 0) {
return NO_SUCH_PAGE;
} else {
Graphics2D g2d = (Graphics2D)g;
g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
toPrint.printAll(g2d);
return Printable.PAGE_EXISTS;
}
}
}
___________________
come faccio a far apparire un Header e footer che contengano non solo testo ma anche delle gif?