J2SE怎么打印JTABLE?
如题啊。。。try
{
Toolkit kit = Toolkit.getDefaultToolkit();
//获取工具箱
Properties props = new Properties();
props.setProperty( "awt.print.printer ", "Epson5000 ");
props.setProperty( "awt.print.numCopies ", "1 ");
if (kit != null) {
//获取工具箱自带的打印对象
PrintJob printJob = kit.getPrintJob(this, "打印查询结果 ", props);
if (printJob != null) {
Graphics pg = printJob.getGraphics(); //获取打印对象的图形环境
if (pg != null)
{
try
{
jp1.printAll(pg);
this.repaint();
}catch(Exception e)
{
}
}
}
}
这个我尝试过,但是好像连接有问题