Warning Noob: Sending "Hello World!" in Printer using Java Applet

Hello guys!
im a newbie in java programming... i hope that you can help me with my problem.
how can i print "Hello World!" in printer using java applet. lets pretend that the applet is digitally signed.
i tried window.print in javascript but unfortunately, that is not what i am looking for.
thanks for reading my post and i hope that you help me with my quest in java =)

An applet is still part of the Swing package. I assume you're extending JApplet. There isn't anything in the print API that says it can't be done in an applet. Except that you might have to sign your applet Jar file with a digital certificate to get the printing to work.

Similar Messages

  • Computerised call from PC to a mobile using java applets

    i want to know whether it is possible to make a call from PC to mobile using java applets. Please give me a correct reply with proof.

    The situation is like this.
    We are transfering the JAR file from the PC to the Mobile using Bluetooth.
    Our J2ME project is already install on Nokia's 6600 and given to the salesman's on the field. Now i have updated my software and i want to upgrade the same on their mobiles. For this i can't call all the 2000 salesman's who are all over the country (India) to my place to get the latest software installed and configure.
    If i have a GPRS like solution for transfering my file from my PC to the remote mobile. I would be better. If you know any this related to this kindly reply me.

  • How does one know whether or not they use "Java applets"?

    The support doc for the recent Java update (Update 8, for Snow Leopard), entitled "About Java for Mac OS X 10.6 Update 8," advises the following:
    If you do not use Java applets, it is recommended that you disable the Java web plug-in in your web browser.
    How does one know whether or not they use "Java applets"?
    Thanks.
    URL:  http://support.apple.com/kb/HT5243

    K.S. wrote:
    dymar wrote:
    Also, how would I know that a missing applet was causing some feature(s) not to work in a situation where no error mesage was returned?
    Sometimes you have to dig to find out: http://earthnow.usgs.gov/earthnow_app.html
    doesn't tell you directly, but it is mentioned in the FAQ that Java is required. If the content is appropriate, you can always ask here.
    Thanks.  According to that webpage, my "Java is out of date."  When an error message like that is returned, I guess it's clear that "it's a Java problem."  Presumably, one would then just go to java.com and download the applet if he/she wanted to view the webpage.
    I was wondering more about situation when unexplained problems that involved missing Java applets weren't noted in error messages.
    But maybe I'm worrying about something that doesn't really need to be worried about.

  • HT5243 How does one know if they use "java applets"? What do they do? How will I know if I need to 'disable the java web plug-in browser' if I do not use them? ( I'm not very literate in computer-speak.

    How does one know if they use "java applets"? What do they do? How will I know if I need to 'disable the java web plug-in browser' if I do not use them? (Obviously I'm not very literate in computer-speak.)

    Well, when you go to a web page a section of the web page will have a coffee cup picture where the java applet will run. The applet loads then runs. If you are not seeing this behavior then you are not using java. If it make you feel more comfortable then disable the browser java plugin. On my machine I have not disable java- but you
    may what to.

  • Need help : how to send 3 parameters over http using Java POST

    I am trying to sending some data to agency company over http using Java POST
    They need 3 parameters and some contents like below
    1. Cmd : cmd=_RequestInsertNewLead
    2 Live : False
    3 XMLData : 3C%3Fxml+version%3D%........
    I already have XML done ,but I don't know how to send these guy over http
    is that like
    this.out = new DataOutputStream(os);
    out.writeBytes("Cmd");
    out.writeBytes(" cmd=_RequestInsertNewLead");
    out.writeBytes(" Live ");
    out.writeBytes("False");
    anyone could give help :)

    First of all, are you getting any exception?
    You didn't put much logging information in your code.
    You can also try this.Instead of doing sos.println(".....") try to build the output string using string buffer.
    Like:
    StringBuffer sb = new StringBuffer();
    sb.append("Some output");
    sb.append("More output");
    sos.print(sb.toString());
    sos.flush();Let me know if this works.

  • PRINTING  A .tif FILE  TO THE PRINTER USING JAVA CODE

    I WROTE A CODE FOR PRINTING THE FILE .ITS PRINTING ALL FORMAT ,BUT WHEN I GIVE THE EXTENSION AS .tiff ,IT SHOWS IN A POP-UP THAT "PRINNTING FAILED"
    CAN ANYONE SEND ME THE CODE FOR PRINTING .tif FILE?

    AMARSHI wrote:
    I WROTE A CODE FOR PRINTING THE FILE .ITS PRINTING ALL FORMAT ,BUT WHEN I GIVE THE EXTENSION AS .tiff ,IT SHOWS IN A POP-UP THAT "PRINNTING FAILED"
    CAN ANYONE SEND ME THE CODE FOR PRINTING .tif FILE?YOU CANNOT PRINT A TIFF DIRECTLY FROM JAVA SINCE IT WILL NOT LOAD A TIFF!!! YOU HAVE TO USE JAVA ADVANCED IMAGINING TO GET THE FILE TO LOAD AND THERE ARE EXAMPLES ON HOW TO DO THAT IN THE JAI LIBRAIRY. ONCE YOU CAN GET THE TIFF TO LOAD YOU CAN USE WHAT EVER YOU HAVE NOW TO PRINT IT, THERE ISN'T ANY MAGIC, YOU JUST HAVE TO HAVE THE IMAGE LOADED FIRST.

  • Hello World in Web Dynpro Java : exceptions

    Hi
    I am trying out the Hello World tutorial. But hit the error after the deployment and trial run. Please advice. Thanks in advance.
    500   Internal Server Error
    Failed to process request. Please contact your system administrator.
    java.lang.IllegalArgumentException: -1
         at com.sap.tc.webdynpro.clientserver.uielements.adaptbase.IndexedItemsIterator.advanceIndex(IndexedItemsIterator.java:104)
         at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.GridLayoutAdapter$Cells.doNext(GridLayoutAdapter.java:368)
         at com.sap.tc.webdynpro.clientserver.uielements.adaptbase.IndexedItemsIterator.next(IndexedItemsIterator.java:54)
         at com.sap.tc.ur.renderer.nn7.GridLayoutRenderer.renderGridLayoutRowFragment(GridLayoutRenderer.java:401)
         at com.sap.tc.ur.renderer.nn7.GridLayoutRenderer.renderGridLayoutFragment(GridLayoutRenderer.java:312)
         at com.sap.tc.ur.renderer.nn7.GridLayoutRenderer.render(GridLayoutRenderer.java:79)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
         at com.sap.tc.ur.renderer.nn7.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:572)
         at com.sap.tc.ur.renderer.nn7.ScrollContainerRenderer.render(ScrollContainerRenderer.java:74)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.UiWindowRenderer.render(UiWindowRenderer.java:52)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendHtml(HtmlClient.java:1056)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.fillDynamicTemplateContext(HtmlClient.java:456)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendResponse(HtmlClient.java:1240)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.retrieveData(HtmlClient.java:252)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doRetrieveData(WindowPhaseModel.java:595)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:156)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:319)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)

    Hi,
       It is quite hard to find out the problem by seeing only exception trace. I think you are missing one of the mandatory elelments' properties or setting them to invalid values. Please check and let me know if you can give more information.
    Regards,
    Siva

  • Unable to send messag to JMS Queue using Java

    Hi all,
    I am trying to send a string to the JMS queue using java. I am unable to send the message. It is getting failed at the look up for connection factory. I am using the below code for this purpose.
    public static void messageEnqueue(String payload) throws JMSException,
    NamingException,
    IOException {
    Session session = null;
    MessageProducer publisher = null;
    TextMessage message = null;
    Context context = new InitialContext();
    QueueConnectionFactory connectionFactory =
    (QueueConnectionFactory)context.lookup("*java:comp/env/XAConnectionFactoryJNDIName*");
    Connection connection = connectionFactory.createConnection();
    Queue Queue1 =
    (Queue)context.lookup("*java:comp/env/QueueName*");
    session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
    publisher = session.createProducer(Queue1);
    message = session.createTextMessage(Payload);
    connection.start();
    publisher.send(message);
    connection.stop();
    connection.close();
    kindly help on this.
    Thanks
    Edited by: 887737 on Jun 28, 2012 9:47 PM

    887737 wrote:
    Hi EJP,
    This is the Exception I got when I ran the java class directly from Jdeveloper. Can't I run the standalone class directly from Jdeveloper to insert the message into remote queue?
    Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at javamail.MessageEnqueue.messageEnqueue(MessageEnqueue.java:30)
         at javamail.MessageEnqueue.main(MessageEnqueue.java:51)Hmm. The stack trace doesn't involve any JMS code. Is javamail.MessageEnqueue.messageEnqueue your application? It seems to be doing a JNDI lookup, and you haven't configured JNDI properly. Exactly how to do this depends on what JNDI provider you are using. Earlier in the thread you mentioned you were using WebLogic, so the answer may lie in the WebLogic documentation.
    Nigel

  • Printing thru java applet

    Hi !
    I am trying to print using a java applet using the printable interface.I am using jdk1.3.1 and OS
    is windows 2000 or windows NT.
    I'm imporing the following packages.
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.net.*;
    import java.awt.print.*;
    import java.awt.image.*;
    import java.awt.geom.*;
    public class image_applet extends Applet implements Printable
    The problem is that this requires java runtime environment1.4.01 as default plugin in the client
    and works only in higher versions of IE(5.5 and above ) and does not work in netscape.
    I would really appreciate if anyone tells me how to make this work in all the client browsers,
    without having to worry about the plugin.
    Bye,
    Sudhakap

    I too am havin the same problem
    Using the print option of the browswer gives results which arent constant with all browsers and
    if i dont implement Printable then the Applet hangs wihtout printing
    I am sending the code pls let me know if it helps
    When i try it out it is not working
    public class MyApplet extends Applet
         public static void main(String[] args)
              MyApplet a = new MyApplet();
              a.init();
              a.setSize(300,300);
              a.setVisible(true);
         public void init()
              Button b = new Button("Printxx");
              b.addActionListener(new MyAL());
              add(b);
         class MyAL implements ActionListener
              public void actionPerformed(ActionEvent arg0)
                   printComponents(MyApplet.this);
         private void printComponents(Component c)
              {System.out.println("printint1");
                   Toolkit tk = Toolkit.getDefaultToolkit();
                   Frame frame = getFrame(c);
                   Properties props = new Properties();
                   props.put("awt.print.printer","HP DeskJet 810C");
                   props.put("awt.print.numCopies","2");
                   if(tk!= null)
                        System.out.println("printint2" frame " " + c.getName());
                        String name = c.getName()+" print job";
                        PrintJob pj = tk.getPrintJob(frame, name , props);
                        if(pj != null)
                        {System.out.println("printint3");
                             Graphics pg = pj.getGraphics();
                             if(pg!= null)
                                  try
                                       System.out.println("printint4");
                                       c.printAll(pg);                              
                                  }finally
                                       pg.dispose();
                             pj.end();
                        System.out.println(props);
    static Frame getFrame(Component c)
         System.out.println("while 1"+c);
         while((c=c.getParent())!= null )
         {System.out.println("while 2"+c);
              if (c instanceof Frame)
                   System.out.println("while 3 "+c);
                   return (Frame)c;
         return null;
         public void paint(Graphics g)
              g.drawString("hello ", 40, 40);

  • How i use java applet data grid i have many record i need show in grid

    hi master
    sir i have many record i want show all record in applet grid how i use grid in applet
    please send me sample code of java class how send many record to grid and applet code how use applet grid
    thanks
    aamir

    Duplicate post:
    how use the jtable in java applete
    Aamir,
    If you use JApplet then you can use JTable. Just do an Internet search for "JTable" and "applet".
    Good Luck,
    Avi.

  • Using Java Applets for verification

    Hello,
    I have 3 submit buttons on a page. I would like to verify which button has just been pressed before the user is directed to the asp page specified by the form. Am I right in saying that an applet is what I should use to do this? - in which case I might not want it to display - is this possible too?
    As you can see I am fairly new to all of this and would greatly appreciate advice.
    Many thanks,
    Polly Anna

    You can use Javascript (which has nothing, nothing at all to do with Java btw) to submit a form, instead of a submit button. That way, you can make your three buttons ordinary buttons instead of submit buttons, and have each of them call a Javascript function, with e.g. the button's name as a argument.
    In this function, you can then set a hidden request parameter indicating which button was used.
    Using an applet for this would be overly complicated IMO.

  • Create the graph using java applet

    Hi friends,
    I have one urgent requirement.I need to create the flowchart by using java code.I have data in database.based on that i need to create the parent child relationchip graph..plase anybody help me .
    Thanks&Regards,
    Yousuf alam.A

    malcolmmc wrote:
    JFreeChart has been the favourite Java graph drawing library but, last time I looked, it didn't do flowcharts. If I were you I'd fire up Google and hunt around for a 3rd party library that does. Of course it's a pain if you have to use such libraries in an Applet. It's generally better to generate an image file on a server and display it as part of your html page.Sorry Malcolm but I don't think JFreeChart is applicable. The OP is asking for Flowcharts which are a graph as in nodes and edges. JGraph (Google) is probably what the OP wants but he is in for a shock when it comes to using it.

  • Using Java Applet in WebDynpro Application

    Hello,
    I have the problem that I must access the client in my WebDynpro Application.
    But I found no way to include a Java Applet in my application, so my question: Is it generally possible to include a Java Applet or not?
    If it is not possible with an Applet, is there any other way to access the client?
    Thanks a lot

    We actually embed Java applets in our application. But only on the portal.
    Wrap the applet around a BSP.
    Call the URL in an iframe.
    To prevent the reloading problems that we see with applets and actions, we put the applet in a modal window, with an OK button at the bottom so that when applet processing is finished, the rest of the web dynpro functionality resumes.
    If you need to have them both in the same page, you can embed the BSP iview in the same portal page.

  • How to use java applets inside visual basic

    hi everyone,
    i am new to programming specially java so please bear with me.
    having said that i am looking for a way to embed java applets in visual basic. so
    1) is it possibele?
    2) if yes(which i believe) then how?
    we are supposed to use VB but i hate it so looking for this way .
    any suggestions and help is whole-heartedly welcome.
    kindly help me.
    you can post ur replies here or mail me directly at my e-mail id
    [email protected]

    thanx
    i have 2 more queries.
    1) is this IE ACTIVE-X CONTROL present by default in VB or do i have to download some add-ons?
    2) how do i write a concurrent server in java . i mean is there any thing equivalent to the UNIX system's FORK()?what if i have to implement this in an applet?
    thanx again.

  • Create a file at a Windows Vista using java applets

    I have created a java applet which is downloaded to create local file at a Windows Vista PC. The java codes are:
    File out = new File("c:/users/test/hkuesd.properties");
    FileWriter fw = new FileWriter(out);
    PrintWriter pw = new PrintWriter(fw, true);
    pw.println("#sample property file");
    pw.println("key_path=C:/");
    pw.close();
    fw.close();
    If I turn off "Users Account Control" under "Control Panel" --> "User Accounts", the file "hkuesd.properties" is created at c:\users\test and can be found using windows explorer.
    However, if I turn on "Users Account Control", I can not find the file "hkuesd.properties" using windows explorer. But the file can be detected if I run another java applet program with the following codes:
    File xpdir = new File("c:/users/test/hkuesd.properties");
    FileInputStream fis = null;
    if (xpdir.exists()) {
    try {
    fis = new FileInputStream("c:/users/test/hkuesd.properties");
    Properties p = new Properties();
    p.load(fis);
    fis.close();
    privateKeyPath = p.getProperty("key_path", "no value");
    catch (Exception e) {}
    Interestingly, if "Users Account Control" is on and I created the file "c:\users\test\hkuesd.properties" manually, the file creation codes
    mentioned above seems to create another "hkuesd.properties" at the same "c:\users\test". The evidence is I run the second java applet program which can detect the one created by the first java applet but not the one I created manually.

    I agreed that it is hardly explained in words. I
    suggested to write two
    simple java applets using the codes and you will see
    the effects:
    (1) the first applet can create a file
    "hkuesd.properties"
    (2) cannot find the file using windows explorer to
    search the whole drive.
    (3) However, can read the content of the file using
    second applet.You still haven't address your problem of swallowing exceptions. Your code might be throwing an exception that tells you exactly what the problem is. Change your code to display or log that exception.

Maybe you are looking for

  • Creation of accounting docs

    I am having trouble to create accounting documents for a billing document in VF02. Can anybody let me know what are the fields to be given to post an accounting document along with the path. Thanks, Mary.

  • How do i get iTunes working again?

    I am running windows 7 64-bit on my PC and recently I have had problems with iTunes. When I click on the iTunes icon, it shows, that it is loading just for a split of a second and iTunes won't open. It only opens in safe mode. A few days ago I instal

  • Help in Tuning this Query

    Hi, I have a query in my proj where the same table is looked up twice in the same query. Can anybody suggest in improving the performance of this query? select * from table1 a1 where (a1.column1, a1.column2, a1.column3, a1.column4, a1.column5, a1.col

  • Is there a link EKBE PO# (EBELN) to the FI Logistics doc in BSAK (BELNR)?

    Is there another table besides BSEG to link EKBE PO# (EBELN) to the FI Logistics doc in BSAK (BELNR) for a data pull? Our problem is EKBE contains Material Doc# and we need the FI/AP Logistics document which is in BSAK.  We are using BSEG but it is s

  • Sql query to identify all the responsibilities attached to a form

    (oracle - apps) Can anyone help me by giving a sql query to identify all the responsibilities attached to a form and corresponding menu should not be in the menu exclusion. Thanks in advance Venki