Posted Wednesday, October 13, 2004 @ 14:48:19
Hi
I am trying to get my table to print in landscape mode. I am using the LANDSCAPE mode in my instantiation of PrintProperties. However, both the print preview and the print output are still in Portrait mode.
// IO Variables
protected TablePrintProp printProp;
.
.
.
// Set up the print properties
public class TablePrintProp extends PrintProperties {
String title;
int borderHeight = 30;
int borderWidth = 30;
public TablePrintProp( String passTitle, int mode ) {
super( mode );
title = passTitle;
}
public int getBorderHeight() {
return borderHeight;
}
public int getBorderWidth() {
return borderWidth;
}
public String getHeader() {
return title + "\nDate: " + new java.util.Date() + "\n ";
}
public String getFooter() {
return "Page: %1% - %2%";
}
public int getHeaderAlign() {
return SwingUtilities.CENTER;
}
public int getFooterAlign() {
return SwingUtilities.LEFT;
}
public Color getHeaderColor() {
return Color.red;
}
public void setTitle( String passTitle ) {
title = passTitle;
}
public void setBorderHeight( int height ) {
borderHeight = height;
}
public void setBorderWidth( int width ) {
borderWidth = width;
}
}
.
.
.
// Setup the default print Properties
printProp = new TablePrintProp( "Lookup Table Listing", TablePrintProp.LANDSCAPE );
.
.
.
public void actionPerformed(ActionEvent e) {
if( e.getSource() == printButton) {
//print the contents in quicktable using the printProperties
dBTable1.print(printProp);
}
else if( e.getSource() == previewButton) {
//show the print preview window using the given printProperties
dBTable1.printPreview(printProp);
}
Do you have any ideas?
Regards
Ron Troyer