wood burning stoves 2.0*
The moose likes Linux / UNIX and the fly likes support for java.awt package on Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "support for java.awt package on Linux" Watch "support for java.awt package on Linux" New topic
Author

support for java.awt package on Linux

juilee rawale
Greenhorn

Joined: Aug 31, 2005
Posts: 7
Hi all,

I am trying to develop application to print text file from java, on linux. I have paginated the text file and have formed object of Book class. Then I have used
job_ = PrinterJob.getPrinterJob();
job_.setPrintService(selectedService_);
job_.setPageable(pages_); //pages object of Book class
job_.print(aset_); //aset_ object of PrintRequestAttributeSet
This is working on Linux advanced server 4 but not on Linux advanced server 3.

Can anyone help me to find out what can be the problem???
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Not working could mean:
- compile errors (which?) (I' don't think so.)
- Exceptions at runtime (which?)
- garbage output
- silently ignored (do the printlogs tell you something?)
- something I didn't thought about.


http://home.arcor.de/hirnstrom/bewerbung
juilee rawale
Greenhorn

Joined: Aug 31, 2005
Posts: 7
not working means its not printing any data from the file.
on Linux advanced server 4 the file is properly printed, but on Linux advanced server 3 the printer just skips pages. i.e. if I try to print 3 pages it skips 3 blank pages and doesn't print anything

plz help me to find the reason

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

Don't you have to do a start and end page operation?

Or was that some other programming environment? I'm too lazy to RTFM.

I know in some platforms, failing to bracket page print requests can cause nothing to print, or have it all come out all overlaid on the last page.


Customer surveys are for companies who didn't pay proper attention to begin with.
juilee rawale
Greenhorn

Joined: Aug 31, 2005
Posts: 7
I have paginated the file and formed object of class Book pages_. pages_ contains Printable i.e. objects of class implementing Printable interface. If I want to print 1-3 pages I paginate the file and append 1-3 pages to pages_. After this I have used

job_ = PrinterJob.getPrinterJob();
job_.setPrintService(selectedService_);
job_.setPageable(pages_);
job_.print(aset_);

i.e. pages_ contains all those pages which I want to print.
In case of Linux advanced server 4 all these pages get printed, but in case of Linux advanced server 3 printer just skips blank pages. If there are 3 pages to print it will skip 3 blank pages!!!
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Do you use cups on both machines?
Did you have a look at the logfiles? /var/log/cups* might be a starting point.
It might be a different location on your machine.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: support for java.awt package on Linux
 
Similar Threads
How can I send text characters to a printer device ?
nothing is happening in action class when i submit a page(struts )
Confused about the whole object/method thing
Java Interfaces
upload utility