I want to make a program that turns a printer to a typewriter: you type a character, it is printed immediately, the page only goes up when a line is finished and only a bit etc.
The question is, is this possible to do with JAVA?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
I want to make a program that turns a printer to a typewriter: you type a character, it is printed immediately, the page only goes up when a line is finished and only a bit etc.
The question is, is this possible to do with JAVA?
a good programmer can write a Java program in any language
you want the printer to print one character at a time, and pause until you type another character? As in the printer actually printing letter by letter upon keypress?
That is what I thought you meant by your question...
By printing less than the height of a character, you probably mean a more modern printer which makes several passes to complete the height of one line of text, and you would be correct.
However, on that note, some printers that print in this manner (my inkjet for example), rolls the page up and down per section adding different colors with multiple side-to-side passes. To watch the page print, it moves up and down about 1/2" several times before scrolling to the next ~1/2" section.
I am not very experienced in printers as far as your question goes, but I would guess it would be possible to do, however making it happen may force you to dig into the driver for the printer.
Hopefully someone with more info can post details. I would like to know if it is possible myself.
...Not that I can think of a reason to do it, other than to say you did it, but I find it interesting just the same...
Did you try reading PrinterJob JavaTM 2 Platform
Std. Ed. v1.4.2 ? And by using this, record Graphics on the printer. You must have to work a little to accomplish your requirements.
Last edited by Mr.777; August 31st, 2012 at 09:31 AM.
Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young.
- Henry Ford