Hallo allerseites,
ich möchte gerne eine Voreinstellung in meinem Druckdialog schaffen, damit ich nicht immer das Querformat manuell auswählen muss.
Weiß jemand wie das geht?
:wink:
ich möchte gerne eine Voreinstellung in meinem Druckdialog schaffen, damit ich nicht immer das Querformat manuell auswählen muss.
Weiß jemand wie das geht?
Code:
void drucke()
{
PrintJob prjob = getToolkit().getPrintJob( this, "Testseite", null );
if( null != prjob )
{
final int iPageResol = prjob.getPageResolution();
Graphics pg = prjob.getGraphics();
if( null != pg && 0 < iPageResol )
{
int iAddY = 18;
int iRand = (int)Math.round( iPageResol * 2. / 2.54 ); // 2 cm Rand
int iPosX = iRand + iRand/4; // Textposition
iPosY=78;
pg.setFont(new Font("TimesNewRoman",Font.PLAIN,20));
pg.drawString(date.getText(), iPosX, 24);
}
prjob.end();
}