Se connecter avec
S'enregistrer | Connectez-vous

est-il possible d'imprimer un applet java?

Dernière réponse : dans Programmation
Lassé par la pub ? Créez un compte

depuis ton applet tu peux ajouter un bouton ou un menu qui execute un truc dans ce genre là :

  1. public void EnvoiImpression(JPanel lePanelAImprimer)
  2. {
  3. Properties props = new Properties();
  4.  
  5. props.put("awt.print.paperSize", "a4");
  6. props.put("awt.print.destination", "printer");
  7.  
  8. PrintJob pJob = parentFrame.getToolkit().getPrintJob(parentFrame,"Printing_Test", props);
  9. if (pJob != null) {
  10. Graphics pg = pJob.getGraphics();
  11. lePanelAImprimer.printAll(pg); // c'est ca qui imprime
  12. pg.dispose();
  13. }
  14. pJob.end();
  15. }
Lassé par la pub ? Créez un compte