Salve ragazzi piano piano a forza di sbattere la zucca sto incominciando a capire il mondo del java. Ora ho un piccolo problema con i processi di stampa, ovvero sto realizzando un sistema di gestione magazzino ... l'ho quasi completato ma ora sto impazzendo con le stampe ...
io devo stampare una bolla, ora io non so quante pagine devo stampare ... ho un ciclo while
while (jcPostgreSQL.query.next()) {

// calcolo X dell'articolo id - perche deve essere stampato dopo il nome visto che è da li che si prende la Y
int latox = (int)((pageFormat.getImageableWidth() - pageFormat.getImageableX() * 2) * 6 / 100);
scorr.x = latox;

oggetti = fun.stampaTestoInRiquadroPercentuale(g2d, pageFormat, scorr.x, metro, 46, 0, "left", jcPostgreSQL.query.getString("nome").trim(), true, false);
scorr.x += oggetti.x;
scorr.y = oggetti.y;

oggetti = fun.stampaTestoInRiquadroPercentuale(g2d, pageFormat, 0, metro, 6, scorr.y, "center", Integer.toString(jcPostgreSQL.query.getInt("listin oid")), true, false);

oggetti = fun.stampaTestoInRiquadroPercentuale(g2d, pageFormat, scorr.x, metro, 10, scorr.y, "right", jcFunzioni.formattaPrezzo(jcPostgreSQL.query.getDo uble("p_vendita")), true, false);
scorr.x += oggetti.x;
oggetti = fun.stampaTestoInRiquadroPercentuale(g2d, pageFormat, scorr.x, metro, 4, scorr.y, "center", jcPostgreSQL.query.getString("um"), true, false);
scorr.x += oggetti.x;
oggetti = fun.stampaTestoInRiquadroPercentuale(g2d, pageFormat, scorr.x, metro, 7, scorr.y, "center", Double.toString(jcPostgreSQL.query.getDouble("qnt" )), true, false);
scorr.x += oggetti.x;
temp = (jcPostgreSQL.query.getDouble("p_vendita") - jcPostgreSQL.query.getDouble("sconto")) * jcPostgreSQL.query.getDouble("qnt");
oggetti = fun.stampaTestoInRiquadroPercentuale(g2d, pageFormat, scorr.x, metro, 10, scorr.y, "right", jcFunzioni.formattaPrezzo(jcPostgreSQL.query.getDo uble("sconto")), true, false);
scorr.x += oggetti.x;
oggetti = fun.stampaTestoInRiquadroPercentuale(g2d, pageFormat, scorr.x, metro, 10, scorr.y, "right", jcFunzioni.formattaPrezzo(temp), true, false);
scorr.x += oggetti.x;
oggetti = fun.stampaTestoInRiquadroPercentuale(g2d, pageFormat, scorr.x, metro, 7.33, scorr.y, "center", Double.toString(jcPostgreSQL.query.getDouble("iva" )) + " %", true, false);

metro += scorr.y;
oggettiStampati++;

if (metro>fun.FINEPAGINA)
return Printable.PAGE_EXISTS;

}
e se in poche parole non supera la lunghezza fun.FINEPAGINA fa
return Printable.NO_SUCH_PAGE;
il fatto è che mi stampa una pagina bianca ... io da bravo programmatore ho fatto un debug e ho notato che il parametro pageIndex aumenta di 1 dopo aver eseguito 2 volte la funzione print ... è normale ??

grazie Sascha