Bonjour,
Je veux imprimer ma table sur deux feuilles, si j'utilise PrintMode.NORMAL il me l'imprime sur 4 feuilles
voici mon code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 table_1 = new JTable() { public java.awt.print.Printable getPrintable(PrintMode printMode, MessageFormat headerFormat, MessageFormat footerFormat) { return new printtable(table_1, printMode, headerFormat, footerFormat); }; };
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 try { table_1.print(PrintMode.FIT_WIDTH, new MessageFormat("<html><body><p><i> LE "+textField.getText()+ " -- "+ textField_1.getText()+"</i></p><p><i>Liste des clients du projet :"+comboBox.getSelectedItem().toString()+"</i></p><p>Nombre des clients:"+ txtnbr.getText()+"</p></body></html>"),new MessageFormat("") ); } catch (PrinterException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } });
Partager