Java & MySQL, Printing
Posted on 2004-11-15
I have a MySQL table which I have written a Java Application to add, navigate and (am currently working on) delete records. However, I would also like to add print function but am unsure how to do this.
Image I have a table wtih 4 fields:
I understand how to create an SQL query to find the relevant records requested. My problem is 2 fold but associated:
1. How do I ensure that the output when it is printed does not scroll off the end of my screen, for example, if My screen could display say 50 lines and the number of records returned was 75, how could I stop the page from scrolling off after line 51?
2. How do I create a report in Java, perhaps with a print preview option, with the same critieria as #1, i.e make sure the report stays on the page and has headers and footers etc.?
I'm guessing these should be possible but I cannot find anything on this on the net so would be grateful for any advice, links or whatever.