java - printing only filled data from JTable with logo -


my program hava jtable 100 blank rows. let user fills 10 rows. want print filled rows logo on top. how ?

here code used:

if(e.getsource() == print){     try {         table.print(jtable.printmode.fit_width, head, null);      } catch (java.awt.print.printerexception e1) {          system.err.format("cannot print %s%n", e1.getmessage());      } } 

it prints 100 rows.

i want print filled rows( let first 10 rows filled)

you can filter empty rows before printing:

table.setautocreaterowsorter(true); rowfilter filter = new rowfilter() {      public void include(entry entry) {         // here add loop checks if          // of values in entry not-null         // return true if yes, false otherwise (that empty)     } }; ((defaultrowsorter) table.getrowsorter()).setrowfilter(filter); table.print(....); 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -