本文整理汇总了Java中java.awt.print.PrinterException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java PrinterException.printStackTrace方法的具体用法?Java PrinterException.printStackTrace怎么用?Java PrinterException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.print.PrinterException
的用法示例。
在下文中一共展示了PrinterException.printStackTrace方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initRootView
import java.awt.print.PrinterException; //导入方法依赖的package包/类
private void initRootView(final PageFormat pageFormat) {
pane.setSize((int) (pageFormat.getImageableWidth() / SCALE),
Integer.MAX_VALUE);
pane.validate();
rootView = pane.getUI().getRootView(pane);
pages.clear();
pageStartY = 0;
pageEndY = 0;
currentPage = -1;
this.pageFormat = pageFormat;
int pageIndex = 0;
try {
while (print(null, pageFormat, pageIndex) == PAGE_EXISTS)
pageIndex++;
} catch (final PrinterException e) {
e.printStackTrace();
}
}
示例2: printTest
import java.awt.print.PrinterException; //导入方法依赖的package包/类
private static void printTest() {
MediaTray tray = null;
//tray = getMediaTray( prservices, "Bypass Tray" );
tray = getMediaTray( prservices, "Tray 4" );
PrintRequestAttributeSet atrset = new HashPrintRequestAttributeSet();
//atrset.add( MediaSizeName.ISO_A4 );
atrset.add(tray);
PrinterJob pjob = PrinterJob.getPrinterJob();
pjob.setPrintable(new TestMediaTraySelection());
try {
pjob.print(atrset);
} catch (PrinterException e) {
e.printStackTrace();
fail();
}
}
示例3: actionPerformed
import java.awt.print.PrinterException; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
try {
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(testInstance);
if (job.printDialog()) {
job.print();
}
} catch (PrinterException ex) {
ex.printStackTrace();
}
}
示例4: actionPerformed
import java.awt.print.PrinterException; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(this);
if (job.printDialog()) {
try {
job.print();
} catch (PrinterException ex) {
ex.printStackTrace();
}
}
}
示例5: printTest
import java.awt.print.PrinterException; //导入方法依赖的package包/类
private static void printTest() {
job.setPrintable(new TestCheckSystemDefaultBannerOption());
try {
job.print();
} catch (PrinterException e) {
e.printStackTrace();
}
}
示例6: main
import java.awt.print.PrinterException; //导入方法依赖的package包/类
public static final void main( String[] parameters ) {
PrinterJob printjob = PrinterJob.getPrinterJob();
printjob.setJobName( "Test Print Job" );
PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
attributes.add( OrientationRequested.LANDSCAPE );
try {
printjob.setPrintable( new Painter() );
printjob.print( attributes );
} catch( PrinterException exception ) {
exception.printStackTrace();
}
}
示例7: printTest
import java.awt.print.PrinterException; //导入方法依赖的package包/类
private static void printTest() {
job.setPrintable(new BannerTest());
if(job.printDialog()) {
try {
job.print();
} catch (PrinterException e) {
e.printStackTrace();
fail();
}
}
}
示例8: printWorks
import java.awt.print.PrinterException; //导入方法依赖的package包/类
public void printWorks(String[] args)
{
PrinterJob job=PrinterJob.getPrinterJob();
job.setPrintable(this);
PrintRequestAttributeSet settings=new HashPrintRequestAttributeSet();
PrinterResolution pr = new PrinterResolution(300, 300, ResolutionSyntax.DPI);
if (args.length > 0 && (args[0].compareTo("600") == 0)) {
pr = new PrinterResolution(600, 600, ResolutionSyntax.DPI);
System.out.println("Adding 600 Dpi attribute");
} else {
System.out.println("Adding 300 Dpi attribute");
}
PrintService ps = job.getPrintService();
boolean resolutionSupported = ps.isAttributeValueSupported(pr, null, null);
System.out.println("Is "+pr+" supported by "+ps+"? "+resolutionSupported);
if (resolutionSupported) {
System.out.println("Resolution is supported.\nTest is not applicable, PASSED");
}
settings.add(pr);
if (args.length > 0 && (args[0].equalsIgnoreCase("fidelity"))) {
settings.add(Fidelity.FIDELITY_TRUE);
System.out.println("Adding Fidelity.FIDELITY_TRUE attribute");
}
if (job.printDialog(settings))
{
try {
job.print(settings);
} catch (PrinterException e) {
e.printStackTrace();
}
}
}