@@ -0,0 +1,2456 @@
+/*%0A * The MIT License%0A *%0A * Copyright 2013 SocialWare.%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in%0A * all copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN%0A * THE SOFTWARE.%0A */%0A%0Apackage com.ism;%0A%0Aimport java.awt.*;%0Aimport java.awt.event.*;%0Aimport javax.swing.*;%0Aimport java.awt.print.*;%0A%0A/**%0A *%0A * @author Adrian%0A */%0Apublic class Imprimir implements Printable, ActionListener%7B%0A    public void actionPerformed(ActionEvent e) %7B%0A        System.out.println(%22actionperformred%22);%0A        PrinterJob job = PrinterJob.getPrinterJob();%0A        job.setPrintable(this);%0A        boolean ok = job.printDialog();%0A        if (ok) %7B%0A            try %7B%0A                job.print();%0A            %7D catch (PrinterException ex)%0A            %7B /* The job did not successfully complete */ %7D%0A        %7D%0A    %7D%0A    public int print(Graphics g, PageFormat pf, int page)%0A      throws PrinterException %7B%0A        // We have only one page, and 'page'%0A        // is zero-based%0A        if (page %3E 0) %7B%0A             return NO_SUCH_PAGE;%0A        %7D%0A%0A        // User (0,0) is typically outside the%0A        // imageable area, so we must translate%0A        // by the X and Y values in the PageFormat%0A        // to avoid clipping.%0A        Graphics2D g2d = (Graphics2D)g;%0A        g2d.translate(pf.getImageableX(), pf.getImageableY());%0A%0A        // Now we perform our rendering%0A        g.drawString(%22Hello world!%22, 100, 100);%0A%0A        // tell the caller that this page is part%0A        // of the printed document%0A        return PAGE_EXISTS;%0A  %7D%0A%7D%0A

version hello world de impirmir