Ola ,
Como faço para capturar um panel em uma frame e imprimir , sendo que o tamanho da área de impressão
é de
width=612 x height=792
e as dimensoes do panel
é de
width=671 x height=552
font monospaced , 12
estou usando a seguinte rotina para fazer isto , mas na impressão está sempre cortando as margens
direita e esquerda .
file.add(tmp = new JMenuItem(“Imprimir”));
tmp.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_MASK));
tmp.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
if (setup.getComponents().get(“Terminal”) != null) {
PrintJob printJob = frame.getToolkit().getPrintJob(frame, “Terminal”,null);
if (printJob == null) return;
((JComponent) setup.getComponents().get("Terminal")).print(printJob.getGraphics());
printJob.end();
}
}
});
Agradeço antecipadamente a quem puder me ajudar,
Paulo Batista