如何JTable打印PageSetup?

时间:2017-03-17 00:20:27

标签: java oracle printing installation

如何在布局选项卡中设置边框度量?

// print JTable
PrintRequestAttributeSet set = new HashPrintRequestAttributeSet();
set.add(OrientationRequested.LANDSCAPE);
try {
    tableToPrint.print(JTable.PrintMode.NORMAL, null, null, true, set, false);
} catch (PrinterException e) {
    e.printStackTrace();
}

以前搜索过:

https://docs.oracle.com/javase/7/docs/api/javax/print/attribute/AttributeSet.html https://docs.oracle.com/javase/7/docs/api/javax/print/attribute/DocAttributeSet.html https://docs.oracle.com/javase/7/docs/api/javax/print/attribute/PrintJobAttributeSet.html https://docs.oracle.com/javase/7/docs/api/javax/print/attribute/PrintRequestAttributeSet.html

1 个答案:

答案 0 :(得分:0)

我正在寻找HashPrintRequestAttributeSet属性:

new MediaPrintableArea(int,int,int,int,MediaPrintableArea.MM)

https://docs.oracle.com/javase/7/docs/api/javax/print/attribute/Attribute.html