Generating a receipt dynamically

i want to create a bill receipt in which the items are fetched from data base bill will generated. I have used the above code for that but the problem i am facing is its format. How can I put it in a proper bill receipt format?

asked Oct 20, 2014 at 8:45 user4145156 user4145156

This is a very general question and you should consider reading some intermediate/advanced Swing layout tutorials.

Commented Oct 20, 2014 at 8:47

Please execute the above code to see how it is now. And want that in a standard receipt format. on top middle name and address. next line date and time which is right aligned. then bill

– user4145156 Commented Oct 20, 2014 at 9:18

How are we supposed to execute code that has to access a data base to produce output? Also, your description of "standard receipt" is not very clear. How about including an example, either in fixed-width font or as a picture?

Commented Oct 20, 2014 at 9:26 Read about e.g. JasperReports where you can create any desired report with all necessary formats Commented Oct 20, 2014 at 9:27

1) Provide ASCII art, or a simple drawing, of the layout of the GUI. 2) For better help sooner, post an MCVE (Minimal Complete Verifiable Example).