How to check the status of the printer

Hi ,
I am trying to define when:
- the file is printed correctly
- the print job is canceled
- the print job has failed
- the printer require attention (e.g. needs paper)
but i run the application then always output is printDataTransferCompleted,printJobCompleted and no other method is calling.
and another problem is without Listner Print method is working fine but when i m using listner then it wont work.
PrintJobManagment(DocPrintJob job) {
// Add a listener to the print job
job.addPrintJobListener(new PrintJobAdapter() {
public void printDataTransferCompleted(PrintJobEvent pje) {
// The print data has been transferred to the print service
System.out.println("-> 1");
public void printJobCanceled(PrintJobEvent pje) {
// The print job was cancelled
System.out.println("-> 2");
setStatus(2);
public void printJobCompleted(PrintJobEvent pje) {
// The print job was completed
System.out.println("-> 3");
setStatus(3);
public void printJobFailed(PrintJobEvent pje) {
// The print job has failed
System.out.println("-> 4");
setStatus(4);
public void printJobNoMoreEvents(PrintJobEvent pje) {
// No more events will be delivered from this
// print service for this print job.
// This event is fired in cases where the print service
// is not able to determine when the job completes.
System.out.println("-> 5");
setStatus(5);
public void printJobRequiresAttention(PrintJobEvent pje) {
// The print service requires some attention to repair
// some problem.
// Example: running out of paper would cause this event
// to be fired.
System.out.println("-> 6");
setStatus(6);
void setStatus(int iStatus) {
synchronized (PrintJobManagment.this) {
iResult = iStatus;
System.out.println("IRESULT: " + iStatus);
PrintJobManagment.this.notify();
* This method is used to wait until the job has an event that will terminate it.
public synchronized int waitForDone() {
try {
// If no event were executed or if only the data transfert event were
// launched executed or if the canceled job event were launched there
// is nothing to be done.
while (iResult==0)
wait();
} catch (InterruptedException e) {
return iResult;
}

Hi,
I am using jdeveloper11.1.1.2.0.Actually standalone java application,I want to know status of the printer,If there is no paper inside printer then message should be display no paper in the printer,
if i did printout but after 2 second i want to cancel the print then message should be also display ...
if any example u have then give me the example..
Please help me..
Thanks
Anup

Similar Messages

  • How to check the status on the server

    I have a jsp page which runs a tcl program in the background. This tcl program will generate a HTML file and the HTML
    file will be residing in the server. Is there a way in the jsp to check the status on the server so that the moment HTML file is on
    the server and capture the date/time and display in the JSP.
    Thanks

    If the JSP is on the same server, then you can just use the File class to check that the file exists and get the timestamp of the file.

  • How do i find out the status of the ink in the HP 5510 machine?

    Please can you advise how i find out what the status of the ink is in the "HP 5510" machine?

    Hi,
    Please use this:
    From the Printer Home screen, touch the right directional key, and then touch the Ink icon to display the estimated ink
    levels.
    Regards,
    Note: The ink icon is similar to a drp\op of water.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to get the status of the backgroud job?

    Hi all,
    I have a job, there are two steps. I have checked in the table TBTCP, the status is always 'P', which means:job step scheduled, even the step is finished. How can we get the status of every step? Many thanks in advance!

    try FM  BP_JOB_STATUS_GET
    but Table TBTCO(field-status) gives the status of the job i.e whether scheduled,released,active,finished,ready or terminated job.
    check  following tables
    <b>TBTCJSTEP - Background Job Step Overview
    TBTCO - Job Status Overview Table
    TBTCP - Background Job Step Overview</b>
    Message was edited by:
            Vasu G

  • How to identify the status of the data load

    Hi All,
    Here is my requiremenet,
    I have a process called etl_pf2 which loads the data into staging tables. Now I have another process that does a partition exchange and moves the data from staging tables to online tables.
    In one procedure, I need to verify whether any data load into the staging tables is happings. If yes then partiontion should not occur, if no then movement should happen.
    Any idea on any parameter which can be used in the procedure to check the status of the data load in staging tables.
    Please help me.

    Thanx for reply
    But i thhink that the problem is with NQSServer which crashes but not disappears from the processes list.
    I tried to search obiee+USER_MEM_ARGS and nqsserver+USER_MEM_ARGS but found only this thread.
    How can JVM settings help to nqsserver.exe to work properly?

  • How can I change the status of the fileupload UI from disable to enable?

    Hi, experts,
    The Version of my Netweaver studio is 7.0.11.
    I create a view with fileupload UI element in WebDynpro for Java application, but the fileupload UI element is disabled so that I don't select file when I click the button in the fileupload UI element after I run the application.
    How can I change the status of the fileupload UI element from disable to enable?
    Best regards,
    tao

    Hi
    look at this thread [HI Masters , I need information for file upload program in web dynpro java|HI Masters , I need information for file upload program in web dynpro java]
    and check if u bind each file upload element to binary property in the context

  • I sent in my iPod nano to the replacement program about two weeks back. However, I checked the status of the repair and it still says it has not been received yet. Is there any way to follow up on where the nano could be? I sent it via FedEx.

    I sent in my iPod nano to the replacement program about two weeks back. However, I checked the status of the repair and it still says it has not been received yet. However, my boyfriend sent in his the same time I did and his repair status says repair being diagnosed. I still have the "receipt" of the package when they first sent it to me. I sent it via FedEx. Is there any way to follow up on where the nano could be or maybe find out if I can still get a replacement even though my nano might be lost in transit?

    I sent it via FedEx. 
    Call FedEx.  They will be able to track their own packages.  They will let you know if your iPod Nano was delivered and to who!

  • Checking the status of the insert query in JSP

    frendz,
    i am working with JSP .i have some content to be inserted in the database.i have used the insert query in SQL for that.i am able to check whether it has been inserted properly in the SQL but i want to check the status of the insert query with its return value(so that i can confirm it does not return a error).so please help.

    The Statement#executeUpdate() returns an int with the row count. Get hold of it.
    Also see the Statement API: http://java.sun.com/javase/6/docs/api/java/sql/Statement.html
    Apart from this, I recommend you to use PreparedStatement instead. It will not only ease setting Java objects in a query (no hassle anymore with quotes), but it will also prevent you from SQL injections.
    Prepare here: http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html
    SQL injections: http://en.wikipedia.org/wiki/SQL_injection

  • Attachment Downloading in Mail - How do you know the status of the download

    Hi,
    I'm trying to send a keynote presentation from my iMac to my MacBook and it doesn't seem to be working. The attachment shows up in my email, I click on it, and it doesn't really do anything. Is there a way to check the status of the download, or clear all the downloads for mail? I think it's just the size of the file, because pages files work, and even very small keynote files, but not a 3 slide keynote presentation.
    Any help with this would be much appreciated.
    Brandon

    Hi Brandon
    If you want to know quite a lot: http://en.wikipedia.org/wiki/LAN
    In short a Local Area Network is your network at home. Both your computers are somehow conncted to the internet. Most people don't want to afford seperate internet lines for each computer they own, so they build a LAN.
    Many internet providers will give you a modem with more than one network port so you can plug in more than one computers. If there's only one port, most people connect a router to get more ports. If you have wireless at home, you also have a LAN.
    Now to the better options: On both copmuters: Go to system preferences > Sharing. Enable File Sharing. To learn more about it, just click on the question mark button at the lower right.
    After you did this, open a Finder window. In the sidebar there will be a new item: Shared. If you open the triangle you'll see the computer name of your other computer. This can take a few seconds to show up.
    Now you just place the files you want to share in your Public folder so the other Mac can access it.
    Regards,
    --greg

  • Is it possible for me to transfer my downloaded games from my itouch to my ipad? If yes, how?  Will the status of the games be the same?

    is it possible for me to transfer my downloaded games from my itouch to my ipad? If yes, how?  Will the status of the games be the same?

    As long as the apps are still available in the store, and you use the same iTunes account as you originally used to buy them, then you should be able to re-download them for free : http://support.apple.com/kb/HT2519
    If you want to copy over your progress then you will need to try backin up the iPod and restoring that backup onto the iPad - you can't just restore individual apps, it's all or nothing.

  • How to maintain the status of the Thread ?

    How to maintain the status of the Thread ?
    namanc

    I want to know whether a particular thread (java
    application) is completed successfully or not ...
    If the thread is not completed successfully then I
    want to restart the Thread.
    Actually this is the Task Scheduler Application ...
    If the particular task is not running successfully
    then I want to start the Task again ...
    namancThen it could look something like this: // loading the queue
    for each task
        add task to list of incomplete tasks
        enqueue task in work queue
    // dispatcher
    while !done()
        task = workQueue.dequeue();
        New Thread(task).start();When a task finishes, it can call a callback method on the dispatcher. The dispatcher looks at the task's status. If it finished successfully, the task gets removed from the list of incomplete tasks. Else it goes back on the work queue.
    There will be some syncing issues involved. You'll have to use wait() and notify()/notifyAll() to handle the situation where the work queue is empty, and all incomplete tasks are being worked on. And the case where the dispatcher wakes up after the notifyAll() and there's nothing to dequeue and nothing in the list of incomplete tasks.
    Clearly it needs some fine tuning, but I hope you get the idea.

  • How can i get the status of the loaded database in OCI ??

    Hi, buddy!
    Now i wanna get the status of the loaded database,example MOUNT, NOMOUNT,OPEN. Can i use the OCI interface to get it? if it like that,
    how can i do? Otherwise, is there another way to do in program??
    thanks!!

    My friend, thank you very much for your help!
    I have tryed according to you advice. The result is that i can connect database successfully only when the database is in the OPEN mode. I use the V$DATABAES table to find the open_mode and of course the result is OPEN, so it's correct.
    But when the database is in the MOUNT or NOMOUNT mode, i can't connect the database successfully.It will throw the exception "ORA-01033: ORACLE initialization or shutdown in progress".
    Could you tell me why? Special thanks!!!
    Message was edited by:
    user588906

  • How to check Debug messages in the server

    Hi All,
    I am working on extensions and in my java controller file i have certain System.out.println messages. I would like to know how to check these messages from the server for debugging purpose.
    Kindly help me in the same.
    Thanks
    Deeksha

    11i - log file location - $APACHE_TOP/Jserv/logs/jserv.log
    r12 - log file location - $INST_TOP/logs/ora/10.1.3/opmn/oacore_default_group_1/oacorestd.out
    You can prepend your SOP with some text and search for the text in the log files.

  • How to check who has approved the PO or PR?

    Hi,
    Can someone tell, how to check who has approved the PO or PR?
    Regards.

    Go to PO display ME23N go to enviornment data and see for header changes here you can see the person who has release the PO at what dat with time, user id and T-code used for release.
    Else if version management is activated in your client then check at the version tab at the header level of PO here also you will find the required details.
    For PR you can check the item details.
    Regards
    Sujoy
    Edited by: Sujoy on Apr 9, 2009 1:18 PM

  • How to change the status of the system programmatically with Function Module

    I  Was trying to change the status of the notification through STATUS_CHANGE_INTERN function module .  But It is not changing the status of the notification.
    Can any one help to understand what is going wrong ... or any other function module to change status of Customer complaint notification ..

    Hi KK,
    Please can you take clues form the below discussion thread -
    http://scn.sap.com/thread/775169
    Thanks to all original contributors of this thread!!
    NOTE: Please note that the main point explain here is that, if you are willing to change to a status Ex, NOPR, NOCO, etc then you will need to pass on the value 'I0070', 'I0072', etc. I will also go ahead and like to add one more point here to make the language check as well like "EN", 'DE', etc as these statuses are language dependent too.
    Thanks,
    Arijit

  • How can we kow the status of the databse in oracle

    how can we kow the status of the databse in oracle (open or not)
    thanks

    >> select database_role from v$database
    This will give the Current role of the database i.e. PRIMARY
    ,LOGICAL STANDBY, and PHYSICAL STANDBY.
    But OP wanted the database i.e. OPEN or MOUNTED,
    Regards,
    Sabdar Syed.

Maybe you are looking for

  • Exchange Server 2013 - Unattended mode recoverserver fails

    Re-installing CAS server. This is something I have done before without issue. In order to properly upgrade from Server 2012 to 2012 R2, I have actually deleted the VDisk, created a blank. Installed server 2012 R2, ran prerequisites and hit the Exchan

  • Download file

    I have a small servlet that allows the user to download a file. My problem is that I don't know how to check whether or not they accepted to download the file or the hit the 'cancel' button. here is a small chunk of code: res.setContentType("text/pla

  • Change background color in a Review Widget

    Can someone tell me how to change the background color (the white portion) in a review widget?

  • Please designate the path of new firmware

     This message keeps poping up ("Please designate the path of new firmware") when I try to upgrade the firmware of my WRT110 wireless router, even though I used the BROWSE button to select the new firmware .bin file. Anybody has a clue to resolve this

  • Mac OSX 10.6.8 has Mobil Me.  How do I get ICloud?

    My Mac OSX which is running v. 10.6.8 has Mobil Me, but not ICloud.  How do I get ICloud?