In a Java application I print through PrintJob, but the way I print when I call the Print method, it opens a printer dialog so I can choose which one to print, I tried and could not do with which to print without having to call the dialog.
Follow my printing method below.
Print.java
public void imprimir() {
Frame f = new Frame("Frame temporário");
f.setSize((int) 283.46, 500);
f.pack();
Toolkit tk = f.getToolkit();
PrintJob pj = tk.getPrintJob(f, "MP4200", null);
if (pj != null) {
Graphics g = pj.getGraphics();
...Aqui vai os dados impressos...
g.dispose();
pj.end();
}
f.dispose();
}