(Je réécris la question d'origine Le problème est le même.)Impression à partir de JEditorPane
L'exemple de code ci-dessus n'imprime pas l'image. Il apparaît dans la fenêtre mais pas imprimé.
public static void main(String[] args) {
final JEditorPane ed = new JEditorPane(
"text/html",
"<p>Test<br><img src='http://www.google.es/images/logos/ps_logo2.png'></p>");
JFrame f = new JFrame();
f.setLayout(new BorderLayout());
f.add(ed);
JButton b = new JButton("Print");
f.add(b,BorderLayout.SOUTH);
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
try {
ed.print();
} catch (PrinterException ex) {
System.err.println(ex);
}
}
});
f.pack();
f.setVisible(true);
}
Merci beaucoup! – ruX
Java a View, ImageView? Je le sais d'Android ... – barwnikk