Results 1 to 5 of 5
  1. #1
    krishnanr is offline Member
    Join Date
    Aug 2015
    Posts
    3
    Rep Power
    0

    Default Issue in Integrating Swing with JavaPos

    Hi All

    I am trying to integrate the javapos API into my java swing application for calling the printer device connected to the system.

    As part of this integration as a first step, I have downloaded the jcl libraries and jai_core, jai_codec jar files and included them in a sample java project with only one class application.
    I have also installed JavaPos application in my system and the printer is also connected via COM Port to my windows xp machine.


    Now I am trying to access the printer using the below code.

    I am using the following code
    POSPrinter printer = new POSPrinter();
    try {
    printer.open("POSPrinter");
    printer.claim(1);
    printer.setDeviceEnabled(true);
    printer.setMapMode(POSPrinterConst.PTR_MM_METRIC);
    if (printer.getCoverOpen() == true)
    {
    System.out.println("printer.getCoverOpen() == true");
    // cover open so do not attempt printing
    return;
    }
    if (printer.getRecEmpty() == true)
    {
    System.out.println("printer.getRecEmpty()==true");
    // the printer is out of paper so do not attempt printing
    return;
    }
    printer.printNormal(POSPrinterConst.PTR_S_SLIP, "Hello World");
    printer.transactionPrint(POSPrinterConst.PTR_S_REC EIPT, POSPrinterConst.PTR_TP_TRANSACTION);
    } catch (JposException e) {
    e.printStackTrace();
    }


    and on execution of this class it throws the following error.

    java.lang.NoClassDefFoundError: javax.media.jai.PlanarImage

    But this PlanarImage class is already available inside jai_core.jar file which is also available in my application's classpath.

    Can anyone throw light on what is going wrong when I try to run my application please? Waiting for your answer

    Thanks
    Krishnan

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Issue in Integrating Swing with JavaPos

    Please go through BB Code List - Java Programming Forum - Learn Java Programming and edit your post accordingly.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Issue in Integrating Swing with JavaPos

    Quote Originally Posted by krishnanr View Post
    Can anyone throw light on what is going wrong when I try to run my application please? Waiting for your answer
    The most obvious answer is that the class (and its jar) is in fact not on the classpath when running the application. So provide details about how exactly you run it.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    krishnanr is offline Member
    Join Date
    Aug 2015
    Posts
    3
    Rep Power
    0

    Default Re: Issue in Integrating Swing with JavaPos

    Hi,

    I have added the necessary jars in the classpath. I have created a class called EpsonPrint.java and in the main method of this class, included the above code and running it as a java application from eclipse. I am using java 1.7 for this integration.

    Can you let me know if you need any other information regarding my setting? Please help.

    Regards
    Krishnan

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Issue in Integrating Swing with JavaPos

    Quote Originally Posted by krishnanr View Post
    Hi,

    I have added the necessary jars in the classpath.
    That does not explain how you did it. And there is also a sudden existence of Eclipse that was not mentioned before.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. SWing;* ISsue dial dialogbox
    By eppoair2 in forum AWT / Swing
    Replies: 3
    Last Post: 11-29-2010, 10:52 PM
  2. AWT/Swing Mixing Still and issue on MAC OSX?
    By Confused in forum AWT / Swing
    Replies: 2
    Last Post: 02-21-2010, 08:34 PM
  3. Swing Timers Issue.
    By killpoppop in forum AWT / Swing
    Replies: 4
    Last Post: 03-09-2009, 11:17 PM
  4. [SOLVED] Swing Timer issue
    By Doctor Cactus in forum New To Java
    Replies: 6
    Last Post: 03-03-2009, 12:25 PM
  5. Java1.5 Swing Issue
    By naveenbk in forum AWT / Swing
    Replies: 1
    Last Post: 11-23-2008, 08:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •