Send a fake keypress (linux) to a java applet

Hi,
I am having trouble writing a bash script that needs to send a keypress to a to a web embedded java applet...
I can send keypresses fine via xsendkey (http://pag.csail.mit.edu/~adonovan/hacks/xsendkey.html) to other X11 apps.... even the browser that the java applet is running in, but I some how cannot focus on the J app to send a fake keypress there.
Is there any utility I can use to do this... Or is there a simple way to do it in java, I could call a java app from the bash script.
Thanks for any help.

Look into java.awt.Robot.

Similar Messages

  • 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.

  • Linux + Netscape 6 + java to javascript

    Presently I am using Netscape 6 for linux and java plugin 1.3.1_02. I am trying to use code that was used with the older 1.3.1 plugin which worked.
    My problem is that I cannot successfully make the JSObject call: win = JSObject.getWindow(this); from my applet.
    When I make the call, the system crashes. It doesn't even trap an exception. Just closes down the browser.
    So I found out how to get around this by having the javascript send the applet a valid JSObject via a call to my 'setJsobject(JSObject win)' function in my applet.
    This works fine.
    BUT, when I try to use the new found JSObject, I am getting a security violation.
    I need to know what settings or actions can be changed in my system that will allow my java applet to communicate to the javascript of its browser page.
    All help is despirately welcome.
    Mark

    Now that I have a moment of reflection, I did install 1.3.1_02 and found that to get the applet to work, the HTMLconverter stuff has to be removed (no longer needed in 1.3.1_02 according to Sun). You can try with a simple:
    <APPLET ....></APPLET>
    See if that solves the problem for you.
    V.V.
    PS: I had to removed 1.3.1_02 and went back to 1.3.1 for some reasons that I no longer remember (par for the course for an old man like me).

  • Cannot send a null Map key for type 'java.util.HashMap'

    Hi All,
      I am haing an issue with sending data from Server to the client using the AMF Channel.
      Most of the method invocations on the RemoteObject are throwing the following Exception.
    [CODE]
    (mx.rpc.events::FaultEvent)#0
      bubbles = false
      cancelable = true
      currentTarget = (null)
      eventPhase = 2
      fault = (mx.rpc::Fault)#1
        content = (null)
        errorID = 0
        faultCode = "Server.Processing"
        faultDetail = (null)
        faultString = "Cannot send a null Map key for type 'java.util.HashMap'."
        message = "faultCode:Server.Processing faultString:'Cannot send a null Map key for type 'java.util.HashMap'.' faultDetail:'null'"
        name = "Error"
        rootCause = (null)
      headers = (null)
      message = (mx.messaging.messages::ErrorMessage)#2
        body = (null)
        clientId = "22E55FB1-910E-312F-E37A-ED5167139CB0"
        correlationId = "4DB54224-662A-C596-D165-F7C3EBB64DB8"
        destination = "TimeMap"
        extendedData = (null)
        faultCode = "Server.Processing"
        faultDetail = (null)
        faultString = "Cannot send a null Map key for type 'java.util.HashMap'."
        headers = (Object)#3
        messageId = "22E56255-D62F-2ACF-4DA5-CF1E4D6353BB"
        rootCause = (null)
        timestamp = 1266877198902
        timeToLive = 0
      messageId = "22E56255-D62F-2ACF-4DA5-CF1E4D6353BB"
      statusCode = 0
      target = (null)
      token = (mx.rpc::AsyncToken)#4
        message = (mx.messaging.messages::RemotingMessage)#5
          body = (Array)#6
          clientId = (null)
          destination = "TimeMap"
          headers = (Object)#7
            DSEndpoint = "my-amf"
            DSId = "22E53936-7E0E-B21C-C936-EF1078000306"
          messageId = "4DB54224-662A-C596-D165-F7C3EBB64DB8"
          operation = "getMapKey"
          source = (null)
          timestamp = 0
          timeToLive = 0
        responders = (Array)#8
          [0] (com.universalmind.cairngorm.events::Callbacks)#9
            conflictHandler = (null)
            faultHandler = (function)
            priority = 0
            resultHandler = (function)
        result = (null)
      type = "fault"
    [CODE]
    The Spring bean which is exposed as a Remote Object has the following method signature..
    [CODE]
    public String getMapKey() {
            return mapKey;
    [/CODE]
    I am unable to understand why AMF Channel or Blaze DS is treating the String as HashMap !!!
    This was working pefectly fine till yesterday !!
    The version of the BlazeDS i am using is : blazeds_turnkey_3-0-0-544
    and the Flex SDK Version is : flex_sdk_3.5.0.12683
    We recently upgraded to Flex 3.5.0 version earlier we were using 3.3 version
    Thanks
    mars

    Hi All,
    I chcked my server side java beans ( which are managed by Spring) and they are all returning the data property and none of the Keys in the returned hashmaps are null.
    Not sure why this is happening.
    Thanks
    kumars

  • XI Mail Adapter: sending emails with attachment with help of java mapping

    Hi ,
    On trying out the scenerio mentioned in the blog, using the java mapping provided
    "XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
    The scenerio works just fine.
    But the payload as the content of the attachment is not getting generated in proper XML format.
    I suppose it's because of the replace special characters code part..
    Can anyone help me state the modification required in the code.
    Thanks!
    Regards,
    Faria Mithani

    It might be a codepage issue. Is your original payload UTF-8?

  • Java applet and Linux RedHat7.1 kernel  2.4.2-2

    Hello.
    I have really interesting problem...
    I am trying to run java applet in different env.:
    #1. windows2000, sun java1.3.1, webstart 1.0.1;
    #2. linux RedHat 7.1 kernel 2.4.2-2, sun java1.3.1, webstart 1.0.1;
    #3. linux RedHat 7.0, kernel 2.2.16-22, sun java1.3.0-01, webstart 1.0.1;
    #4.SunOs5.8, sun java1.3.0, webstart 1.0.1.
    I found that webstart can't launch applet into a full size under #2.
    Applet runnable, no error msg in java console, but the applet frame
    size is decrease into min. At the same time this application perfectly
    runnable without any changes under the other env.(#1, #3, #4).
    JNLP file:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for FpEdit.jar Application -->
    <jnlp
    spec="1.0+"
    codebase="http://www.mycodebase"
    href="FpEdit.jnlp">
    <information>
    <title>Ufp Editor Application</title>
    <vendor>ME</vendor>
    <homepage href="http://www.myhomepage"/>
    <description>Ufp Editor Application</description>
    <description kind="short">
    Swing Graphical User Interface.
    </description>
    <offline-allowed/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.3+" initial-heap-size="30m" max-heap-size="50m"/>
    <jar href="http://www.myhref/SFpEdit.jar"/>
    </resources>
    <applet-desc
    documentBase="http://www.mydocumentbase"
    name="FpEdit"
    main-class="FpEdit"
    width="950"
    height="590">
    </applet-desc>
    </jnlp>
    May be somebody can explain me what is the problem???
    Thank's.

    Sorry about replay, but may be somebody can help me...
    For me ==> this is a problem between new
    linux kernel 2.4.. and java...

  • How to send data to bam data object through java code

    how to send data to bam data object through java code

    I've made a suggestion in other thread: https://forums.oracle.com/thread/2560276
    You can invoke BAM Webservices (Using Oracle BAM Web Services) or use JMS integration using Enterprise Message Sources (http://docs.oracle.com/cd/E17904_01/integration.1111/e10224/bam_ent_msg_sources.htm)
    Regards
    Luis Fernando Heckler

  • How to execute Linux command from Java app.

    Hi all,
    Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
    Thanks a lot,

    You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
    If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
    You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
    java.io.BufferedReader br =
    new java.io.BufferedReader(new java.io.InputStreamReader(
    Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
    getInputStream()));
    while ((s = br.readLine()) != null) {...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Execute linux command from java

    I wanna execute linux command from java, bu the output has error:
    Return code = 1
    top: failed tty get
    The code as:
    import java.io.*;
    public class Execute {
         public static void main(String[] args) {
              try {
                   final Process process = Runtime.getRuntime().exec("top");
                   new Thread() {
                        public void run() {
                             try {
                                  InputStream is = process.getInputStream();
                                  byte[] buffer = new byte[1024];
                                  for (int count = 0; (count = is.read(buffer)) >= 0;) {
                                       System.out.write(buffer, 0, count);
                             } catch (Exception e) {
                                  e.printStackTrace();
                   }.start();
                   new Thread() {
                        public void run() {
                             try {
                                  InputStream is = process.getErrorStream();
                                  byte[] buffer = new byte[1024];
                                  for (int count = 0; (count = is.read(buffer)) >= 0;) {
                                       System.err.write(buffer, 0, count);
                             } catch (Exception e) {
                                  e.printStackTrace();
                   }.start();
                   int returnCode = process.waitFor();
                   System.out.println("Return code = " + returnCode);
              } catch (Exception e) {
                   e.printStackTrace();
    }Help please.

    Your code is probably good to run a program, that does not use terminal capabilities.
    Program "top" is a little bit more complicated - you have to run it with a real terminal.
    Try to run "xterm -e top". You can find an example how to run an external program
    from java code in cnd/gdb module on http://cnd.netbeans.org
    For example, take a look at openExternalProgramIOWindow() method on this page:
    http://cnd.netbeans.org/source/browse/cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/proxy/Attic/GdbProxyCL.java?rev=1.1.2.6.2.5&only_with_tag=release551_fixes&view=markup
    It runs a command with external terminal.
    Thanks,
    Nik

  • Unable to execute Linux command from Java

    Hi,
    I am currently working on a code wherein i need to execute Linux command from Java. Below are some of the query i have.
    1) Is there any efficient method of running OS commands from Java, rather than using Runtime and Process method.
    2) Below is details of my code which fails in execution
    **-- Java Version**
    java version "1.6.0"
    OpenJDK Runtime Environment (build 1.6.0-b09)
    OpenJDK Server VM (build 1.6.0-b09, mixed mode)
    -- Program Code ----
    Where <path> = Path i put myself
    package test;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.*;
    public class GetInode{
         * @param args
         public static void main(String[] args) {
              GetInode test = new GetInode();
              test.getInode();
         public void getInode(){                    
              String command = "/usr/bin/stat -Lt <path>;
              System.out.println(command);
              Process process;
              Runtime rt;     
              try{
              rt = Runtime.getRuntime();               
              process = rt.exec(command);
              InputStreamReader isr = new InputStreamReader(process.getErrorStream());
              BufferedReader bre = new BufferedReader(isr);
              BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream());
              System.out.println(bre.readLine());
    System.out.println(br.readLine().split(" ")[7]);
              process.destroy();          
              }catch (Exception ex){
                   System.out.println("Error :- " + ex.getMessage());
    ------Output -------------
    /usr/bin/stat -Lt "<path>"
    /usr/bin/stat: cannot stat `"<path>"': No such file or directory
    Error :- null
    Can any one help me what is wrong and why i am unable to run the Linux command from Java.

    For clarity purpose............i m submitting actual code here
    --- Code ---
    package test;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.*;
    public class GetInode{
    * @param args
    public static void main(String[] args) {
    GetInode test = new GetInode();
    test.getInode();
    public void getInode(){               
    String command = "/usr/bin/stat -Lt \"/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt\"";
    System.out.println(command);
    Process process;
    Runtime rt;
    try{
    rt = Runtime.getRuntime();
    process = rt.exec(command);
    InputStreamReader isr = new InputStreamReader(process.getErrorStream());
    BufferedReader bre = new BufferedReader(isr);
    BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
    System.out.println(bre.readLine());
    System.out.println(br.readLine().split(" ")[7]);
    process.destroy();
    }catch (Exception ex){
    System.out.println("Error :- " + ex.getMessage());
    --- Output ---
    [ratz]s0898671: java GetInode
    /usr/bin/stat -Lt "/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"
    /usr/bin/stat: cannot stat `"/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"': No such file or directory
    Error :- null
    -- Linux Terminal --
    If i copy the first line from the output and execute on Linux terminal her is the output that i get
    [ratz]s0898671: /usr/bin/stat -Lt "/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"
    /afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt 12003 24 81a4 453166 10000 1c 360466554 2 0 1 1246638450 1246638450 1246638450 4096
    Can you just assist me where am i really making mistake.......i was wondering if the command that i pass from Java....can be executed on Linux terminal why is it faling to run from java.........and when i print the Error Stream for process output........it show cannot Stat.......

  • Send mail from Enterprise Linux

    We have a couple of servers running Enterprise Linux v5.3. What we want is to be able to send mail from those linux servers to internal and external mail adresses. In SuSE it is fairly simple to configure your MTA but Enterprise Linux I cannot find where to configure a outgoing mailserver. I don't want the configure the servers as a mail server but simply be able to send mails from those server.
    Can someone help me?
    Cheers,
    Wierd van der Haar

    Since OEL is a derivative of RedHat (even the numbering scheme matches), and since RedHat Enterprise is derived from Fedora, you could use web searches to find out how to do this by referencing the search to RedHat or Fedora insteadd of Oracle ENteprise Linux.
    That said, the apporpriate place to ask such a question is where the Linux people hang out. Click on "Forum Home" at the top of the page, scroll down to "Linux" (in the "Technology" category) and ask there. Since the inhabitants of that corner all deal with Linux the probability of getting a useful answer is much higher than here.
    http://www.joreybump.com/code/howto/smtpauth.html
    http://linuxhelp.blogspot.com/2005/06/change-your-mail-transport-agent-mta.html
    http://www.experts-exchange.com/OS/Linux/Administration/Q_22038591.html
    http://cr.yp.to/qmail.html
    are 4 useful responses to Google query "redhat configure outgoing mta"

  • How to send sms to mobile from tomcatserver using java code?

    Hi,
    Could you please let me know that,
    How to send sms to mobile from tomcatserver using java code? Please provide the code snippet.
    Thanks in advance.

    Yes, but something needs to send that message. You can't just take an arbitrary computer and send an SMS, it does not have the hardware to do that.
    So either you have a mobile through which you do that or more likely - you use some sort of online service to do it. Whatever choice you make will determine what code you will have to write to get it done. Nobody is going to deliver the code to you, that's your job. It is also your job to figure out what service you are going to use.

  • Is it possible to send email notifications in UCM without workflow/java?

    Is it possible to send email notifications in UCM without workflow/java?
    I need to send email notifications when an item is checked-in ,without workflow and without java code.
    Thanks,
    Chely

    Yes. You need subscriptions - see here http://docs.oracle.com/cd/E23943_01/doc.1111/e10797/c04_working_with_files.htm#CSUSG899

  • Apple Remote Desktop - sending SSH commands to linux clients

    Has anyone been able to configure ARD to send SSH commands to linux clients?
    The VNC part works, but not sure how to configure the UNIX commands.
    We are trying to be able to send rpm, df, etc commands to multiple centos clients at one time...
    thanks.

    not sure how to configure the UNIX commands.
    You can't. That's not a feature of ARD.

  • Java applet works in windows and does not work in linux

    Hello, guys!
    I'm working with site which is located in vpn network at work.
    I use browsers firefox 3 and opera.
    When I want to open java applet using firefox or opera at first everything is fine then on the last stage of loading(judging by progress bar) applet hangs(progress bar hangs) and when I reload page firefox shows in the bottom bar: applet <applet's name> bail.
    In windows everything works both in ie6 and firefox 3.
    On both environments I have the jre 6 installed.
    please help!

    Ok, I installed ies4linux and jre 1.5.16. I can work with that but when I start applet screen goes black and window frames dissapear.
    To solve this problem(feature?) I disabled DirectX-based acceleration for Java 2D but that works for javacpl.exe and does not work for my applet.

Maybe you are looking for

  • Failure, can't open Adobe .pdf file - Please Help

    Hello, when I save a .pdf document to SAP (Code: CV01N), as you can see in the picture below, and try to open it, I get the failor "Network address DEFAULT of your computer is not maintained". I'm really new in SAP and don't know how I can change the

  • Anyone have experience using ALE message FIDCC2 in a high volume scenario?

    Hi, We are evaluating the use of message type FIDCC2 to send complete FI documents from one SAP system (logisitics) to another SAP system (finance).  I'm particularly interested in throughput performance, as this will be a high volume scenario (300K+

  • The absolute best case for the BB Playbook!!!

    Ok, I've tried several cases for my Playbook---even a $160 Vaja, the Rolls Royce of cases. Absolutely beautiful Austrailian leather...however it had no cut outs for camera or headphones, therefore worthless. Then I found the Blurex case on Amazon.com

  • How can I purge my daughters info now that I am using the Ipad

    How can I get rid of my daughters info on Ipad 2 now that I am the user?

  • Unable to copy plan data through KP97

    Hi, we are trying to copy plan data from budget to forecast c01 for current fiscal year.We could not copy the plan data. On our investigation we found that if we copy cost centres individually planning data for all but two cost centres are copied.  T