J2EE中如何操纵打印机
来源:百度知道 编辑:UC知道 时间:2024/06/14 19:43:08
编程是否和打印机的具体品牌型号有关?
/**
* @version 1.00 1999-09-11
* @author Cay Horstmann
*/
import java.awt.*;
import java.awt.event.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.awt.print.*;
import java.util.*;
import javax.swing.*;
public class PrintTest
{ public static void main(String[] args)
{ JFrame frame = new PrintTestFrame();
frame.show();
}
}
class PrintTestFrame extends JFrame
implements ActionListener
{ public PrintTestFrame()
{ setTitle("PrintTest");
setSize(300, 300);
addWindowListener(new WindowAdapter()
{ public void windowClosing(WindowEvent e)