Java 8 PrinterException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 PrinterException class.

This code example shows how to use the following methods:printStackTrace
            try { 
 
                printJob.print();
 
            } catch (PrinterException ex) {
                ex.printStackTrace();
            } 
        } 
    } 
 
    private void printURL(String url) {
        XHTMLPanel panel = new XHTMLPanel();
        panel.getSharedContext().setPrint(true);
        panel.getSharedContext().setInteractive(false);
 
        try { 
            panel.setDocument(url);
        } catch (Exception e) {
            e.printStackTrace();
        } 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getLocalizedMessage
        g2.setPaint(Color.BLACK);
 
        try { 
            printable.print(g2, pageFormat, 0);
        } catch (PrinterException e) {
            Logger.getLogger(PrintPreviewPanel.class.getName()).log(Level.INFO, e.getLocalizedMessage(), e);
        } 
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getClass, getMessage
        super.stopRenderer(); 
 
        try { 
            printerJob.print();
        } catch (PrinterException e) {
            log.error(e);
            throw new IOException("Unable to print: " + e.getClass().getName()
                    + ": " + e.getMessage());
        } 
        clearViewportList(); 
    } 
 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
job.print();
			} 
			catch (PrinterException e)
			{ 
				e.printStackTrace();
			} 
		} 
	} 
	 
	private void setImage(BufferedImage image)
	{ 
		this.image.setIcon(new ImageIcon(image));
	} 
	 
	public void activate(IARDrone drone)
	{ 
		 
	} 
 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
        try { 
            if (pjob.printDialog()) {
                pjob.print();
            } 
        } catch (PrinterException e) {
            e.printStackTrace();
        } 
}//GEN-LAST:event_printButtonActionPerformed 
    private final String LAST_PATH = "SimpleHTMLReport_Save_Last_Path";
 
    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
        final String html = this.mHTMLReport;
 
        final String path = NbPreferences.forModule(SimpleHTMLReport.class).get(LAST_PATH, null);
        JFileChooser fileChooser = new JFileChooser(path);
        //fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); 
        int result = fileChooser.showSaveDialog(WindowManager.getDefault().getMainWindow());
        if (result == JFileChooser.APPROVE_OPTION) {
            final File destinationFolder = fileChooser.getSelectedFile();
            NbPreferences.forModule(SimpleHTMLReport.class).put(LAST_PATH, destinationFolder.getAbsolutePath());
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException {
        if (g == null) {
            throw new PrinterException("No graphics specified");
        } 
        if (pf == null) {
            throw new PrinterException("No page format specified");
        } 
        if (pageIndex > 0) {
            return (NO_SUCH_PAGE);
        } 
         
        boolean doubleBuffered = super.isDoubleBuffered();
        super.setDoubleBuffered(false); 
         
        pf.setOrientation(orientation.get());
         
        //Paper paper = new Paper(); 
        //paper.setSize(8.5 * 72, 11 * 72); 
        //paper.setImageableArea(0, 0, paper.getWidth(), paper.getHeight()); 
        //pf.setPaper(paper); 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        /* Graphics and pageFormat are required.  Page index is zero-based */ 
        if (graphics == null) {
            throw new PrinterException("No graphics specified");
        } 
        if (pageFormat == null) {
            throw new PrinterException("No page format specified");
        } 
        if (pageIndex > 0) {
            return NO_SUCH_PAGE;
        } 
 
        if (paperSize.get() != null) {
            pageFormat.setOrientation(paperSize.get().getOrientation());
        } 
 
 
        /* User (0,0) is typically outside the imageable area, so we must 
         * translate by the X and Y values in the PageFormat to avoid clipping 
         */ 
        Graphics2D g2d = (Graphics2D) graphics;
2
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 PrinterException Methods: