当前位置: 首页>>代码示例>>Java>>正文


Java PrinterException.printStackTrace方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:20,代码来源:HTMLPrintable.java

示例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();
        }
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:TestMediaTraySelection.java

示例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();
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:PrintLatinCJKTest.java

示例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();
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:bug8023392.java

示例5: printTest

import java.awt.print.PrinterException; //导入方法依赖的package包/类
private static void printTest() {
    job.setPrintable(new TestCheckSystemDefaultBannerOption());
    try {
        job.print();
    } catch (PrinterException e) {
        e.printStackTrace();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:TestCheckSystemDefaultBannerOption.java

示例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();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:LandscapeStackOverflow.java

示例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();
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:BannerTest.java

示例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();
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:34,代码来源:TestUnsupportedResolution.java


注:本文中的java.awt.print.PrinterException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。