The moose likes Java in General and the fly likes printing to a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "printing to a form" Watch "printing to a form" New topic

printing to a form

Donald Wynn

Joined: Dec 04, 2002
Posts: 29
I want to design a program that has a interface a user can enter a information and after the info is entered the user to then print that info to a form. A example of this is if a user wanted to fill out a credit card app. but was worry about making a mistake...they could enter the desired infomation and then have it printed to the hard copy form. Can I do this in Java? If so how and what will I need?
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Sure, you can do just about anything in Java. At the risk of a flamewar, that doesn't mean that Java is the best language for all tasks. I personally enjoy using it, though, and will (usually) go through the struggle with Java rather than learn a new language that I don't already know.
With that said, you first need to create the user inteface to get the information. You can use either the AWT or Swing classes. I'm sure there is a lot of information on the Net to learn these. I would also suggest that you buy a book that helps you along.
Once you have the GUI done, you need to use the Java Print API to do the printing. This is probably the trickiest part because you need to make sure the output is positioned correctly and that the positioning code is portable between different printers. I haven't used the Print API before, but I am pretty sure you can at least accomplish the first. The second issue will be really tough to completely solve.

Java API Documentation
The Java Tutorial
I agree. Here's the link:
subject: printing to a form
It's not a secret anymore!