I have created general bill maker application on swing in which i’ve to print receipts as the output.
Basically i am not able to understand how can show the list of items on the panel so that it is able to print?
I am using PrintUtilities.java to print
the receipt panel.
What i am trying is to use a JTable for listing item details but if number of items is more than scrollpane viewport hieght than the rest of extra items are not shown and thus unable to print.
What can be the other way if i do not use JTable?
Or a solution with JTable itself.
What i want is to extend my whole dialog vertically if no. of items exceeded rather than using autoscrolls in JTable's scrollpane.
I hope i am clear to my question.
Here is the image of what i am trying.
I wouldn’t use Swing components as printed components. Instead I’d build a PDF of the receipt and let the user print that. Scrolling is just going to be a problem with printing actual swing components that isn’t easy to handle. This is a great PDF library:
http://pdfbox.apache.org/