如何在布局选项卡中设置边框度量?
// 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
答案 0 :(得分:0)
我正在寻找HashPrintRequestAttributeSet属性:
new MediaPrintableArea(int,int,int,int,MediaPrintableArea.MM)
https://docs.oracle.com/javase/7/docs/api/javax/print/attribute/Attribute.html