Jump to content

Recommended Posts

Posted (edited)

este codigo permeti me fazer uma print no pos printer ? isto tambem tem alguns erros mas se for podem me ajudar ?

import jpos.*;
import jpos.events.*;
import jpos.POSPrinter;


/**
*
* @author utilizador
*/

public class JavaApplication2 implements DataListener
{
// Data listener’s method to process incoming scanner data.
public void dataOccurred(DataEvent e)
{
jpos.POSPrinter dc = (jpos.POSPrinter) e.getSource();
String Msg = "POSPrinter DataEvent (Status=" + e.getStatus() + ") received.";
System.out.println (Msg);
try {
dc.setDataEventEnabled(true);
} catch (JposException e){}
}
// Method to initialize the scanner.
public void initPOSPrinter(String openName) throws jpos.JposException
{
// Create scanner instance and register for data events.
jpos.POSPrinter myPOSPrinter = new jpos.POSPrinter();
myPOSPrinter.addDataListener(this);
// Initialize the scanner. Exception thrown if a method fails.
myPOSPrinter.open(openName);
myPOSPrinter.claim(1000);
myPOSPrinter.setDeviceEnabled(true);
myPOSPrinter.setDataEventEnabled(true);
//...Success! Continue doing work...
}
//...Other methods, including main...
}
Edited by brunoais
tags code + geshi
Posted (edited)

Se fosse legível e se indicasses o teu problema, até tentava ajudar-te. Mas essa indentação está demasiado má para eu perceber o código e não identificas qual é realmente o teu problema.

Já agora, aconselho-te a melhorar esse título, é suposto ele identificar o teu problema e não só um assunto vago sobre algo que estás a usar no teu código.

Edited by brunoais

"[Os jovens da actual geração]não lêem porque não envolve um telecomando que dê para mirar e atirar, não falam porque a trapalhice é rainha e o calão é rei" autor: thoga31

Life is a genetically transmitted disease, induced by sex, with death rate of 100%.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.