ludgero1993 Posted June 11, 2013 at 10:52 AM Report #511980 Posted June 11, 2013 at 10:52 AM (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 June 11, 2013 at 02:24 PM by brunoais tags code + geshi
brunoais Posted June 11, 2013 at 02:26 PM Report #512048 Posted June 11, 2013 at 02:26 PM (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 June 11, 2013 at 02:28 PM 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%.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now