close

sddsf fggg dfg sddsf dfgfg 

Java-簡易列印import java.awt.*;import java.awt.print.*;public class PrintString {public static void main(String[] args) { PrinterJob pj = PrinterJob.getPrinterJob(); pj.setPrintable( new myPrintable() ); if (pj.printDialog()) { try { pj.print(); } catch (PrinterException e) { System.out.println(e); }}class myPrintable implements Printable {public int print( Graphics g , PageFormat pf , int pageIndex ) { if (pageIndex != 0) return NO_SUCH_PAGE; Graphics2D g2 = (Graphics2D)g; g2.setFont( new Font( "Serif" , Font.PLAIN , 12) ); g2.setPaint(Color.black); g2.drawString("---------Print String-----------", 85, 85); return PAGE_EXISTS; }} .msgcontent .wsharing ul li { text-indent: 0; } 分享 Facebook Plurk YAHOO!

 

好站連結:http://tw.myblog.yahoo.com/beck46919363































arrow
arrow
    全站熱搜
    創作者介紹

    hhdhpkfne 發表在 痞客邦 留言(0) 人氣()