Starting applications from a Java GUI

Hi,
I am creating a main menu application that will act as a front end for users to a selection of other applications. They will use this main menu application to start any of the other applications.
Most of these other application are written in Java, however, some of the applications have been written in Xview and until I can convert them to Java I have to be able to start them from my main menu application. When I exec these Xview applications they fail every time with the following message:
X Error of failed request: Bad Access (attempt to access private resource denied)
Major opcode of failed request: 89 (X_StoreColors)
Serial number of failed request: 152
current serial number in output stream: 153
Now from what I can gather the problem is (apart from my lack of Xview knowledge) the Xview application is trying to change and lock the colormap which I assume is locked by the java application or something along these lines. I don't suppose anyone has come across this problem themselves and has any suggestions???
Cheers
Jim

Welcome to the forums!
Keynote does not support the use of AppleScript in that fashion.

Similar Messages

  • Launching Java Application From A Java Application

    Hello,
    I am building a compiler and would like to have run feature. The problem is I can not seem to figure out the righ syntax to run and application from my java application.
    Here is the code I am using to run an application:
    public void RunClass()
    try
    Runtime rtr=Runtime.getRuntime();
    Process pr = rtr.exec("java " + CurrentDirectory + FileNoExt);
    String line;
    BufferedReader rerr = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    if((line = rerr.readLine()) == null) { CompileMessageArea.setText("Program Running\n"); }
    while ((line = rerr.readLine()) != null) { CompileMessageArea.append(line +"\n"); }
    rerr.close();
    catch(Exception re) { re.printStackTrace(); }
    The following is an example of what the above would send to the:
    java c:\MyJava\Programs\test
    If you try to type something like that in a DOS prompt it will not work. You must first change to that directory, but I am hoping there is an easy way to change the syntax. On the other hand if you want to compile a program you can type:
    javac c:\MyJava\Programs\test.java
    and it will work just fine. This is kind of funny and I use this syntax for my compiler in my program. You would think that the same syntax would work the same for both compiling and running but it does not. So, I know that if I just know what the correct syntax that dos would except for running an application it would work.
    So, if you have the answer for me PLEASE LET ME KNOW.
    It is easily testable by keying it into the dos prompt.
    Sincerely,
    Eric Kohr

    If you want to do it that way you need to use the environment parameter of the exec() method. Use it to set your classpath to the directory that's need for the java application you are about to run... for instance.
    String[] env = new String[] {"CLASSPATH=c:\classes"}
    String command = "java somePackage.someProgram";
    Runtime.getRuntime().exec( env, command);Where your program is in the file "c:\classes\somePackage\someProgram"
    your mileage may vary :)
    You can also reflectively load classes into the running VM and invoke their main methods. This give you the ablility to control them a bit more.

  • Running a Java application from a Swing GUI

    Hi,
    I was wondering if there is a simple way to run a Java application from a GUI built with Swing. I would presume there would be, because the Swing GUI is a Java application itself, technically.
    So, I want a user to click a button on my GUI, and then have another Java application, which is in the same package with the same classpaths and stuff, run.
    Is there a simple way to do this? Do any tutorials exist on this? If someone could give me any advice, or even a simple "yes this is possible, and it is simple" or "this is possible, but difficult" or "no this is not possible" answer, I would appreciate it. If anyone needs more information, I'll be happy to provide it.
    Thanks,
    Dan

    I don't know if it is possible to run the main method from another Java app by simply calling it...
    But you could just copy and paste the stuff from your main method into a new static method called something like runDBQuery and have all the execution run from there.
    How does that sound? Is it possible?
    What I'm suggeting is:
    Original
    public class DBQuery{
    public static void methodA(){
    public static void doQuery(){
    methodA();
    public static void main(String[] args){
    // Your method calls
    //Your initializing
    doQuery();
    }Revised:
    public class DBQuery{
    public static void methodA(){
    public static void doQuery(){
    methodA();
    public static void doMyQuery(){
    // Your method calls
    //Your initializing
    doQuery();
    // No main needed!!
    //public static void main(String[] args){
    // Your method calls
    //doQuery();
    //}

  • Searching through a database table from a java GUI

    i've created a java GUI using Netbeans which connects to a derby database. a table from this database is placed in my GUI, containing some text in all its rows. Now, i want to create a search function that will look for a given string of text through this table and output the results somewhere. can anyone please give me some tips on how i might go about doing this?
    thanks,
    Karan

    You may put a radio button or check box next to the column name.
    You can also put a drop down list contains option "start by", "end by", "contains" matched to SQL like statement, '%XX', 'XX%' and '%XX' respectively.
    You may also make the column name as a button which user can selected the ordering preference - ascending, descending, default.

  • Start application from applet

    Hi there!
    I have to start an application from applet (is not my idea, i HAVE to do it). That menas (i think) i have a little problem with the java "sand box". How can i make my program run out of it? Signed Applets? Are there also other possibiliys? Can i make as "privat person" signed Applets?
    Thank's

    This is SAX-parser for XML processing. The XML-files are local saved, also the applet and the application. The Parser application seems to start, but (sic!) there is no output, even though the application is OK...

  • Start Application from Terminal without Open

    I need to start an application from the terminal without using open - I'm using the java exec() command to keep a handle to the application process, and when I use open it returns a handle to open instead of a handle to the application. When I try to putting in the application name, it says "cannot execute binary file". The application also won't let me look inside it to find the name of the executable. Is this possible? How do I do this?

    Some applications are not "application bundles". Usually these are older Carbon based apps that may have been ported over from OS 9. <Control>-clicking on these applications will not give you the "Show Package Contents" option because they are not folders (like application bundles are).
    However, you can launch these apps from the command line using "LaunchCFMApp". You'll have to specify the full path to LaunchCFMApp followed by the path to the app you want to launch like this:
    /System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp /path/to/app/you/want/to/launch
    I'm not a java programmer but perhaps you could use a command similar to the above with java's exec().
    HTH,
    Steve
    EDIT: Oops, I just re-read your original post... I suppose even if LaunchCFMApp works with java exec() you may still get handle to LaunchCFMApp instead of the actual application.

  • Launching a java application from another java application

    Hi,
    I'm facing an interesting challenge :-)
    Inside a Java application, I want to start another java application.
    Possible solutions in my list :
    1. Using jakarta commons launcher.
    2. Runtime.exec (make the code platform dependent).
    3. Starting the main method of the other app by create a new Thread inside the current app
    4. I know people did this by calling an ant target from the java application but I don't have
    any sample code, I appreciate any sample code for it.
    Thanks,
    Ali Salehi

    That is an iteresting challenge :)Don't be mean; he's polite, done some investigation and taken the trouble to be clear. The question, presumably, is "has anyone got a different solution or a preference as to which of these is the best?"
    In which case, my advice would be to say that invoking main in a separate thread is fundamentally different from Runtime.exec() because the former would run in the same JVM. Is this what you want? If one app has the other on its classpath then do they need to be separate apps? Could they be modules of a single app?

  • How can I communicate with other applications from my Java application?

    Hello,
    I need help about how can i communicate with other application(say textpad.exe/wordpad.exe/MS word.exe) from my Java program.
    More precisely, I need to know how i can get the current position of the cursor whether it is in any .txt/.doc files, then I may write some text in my java application and click a button and then my program will append the line(string) in that position of the file which is running under another appliction(Notepade.exe/MSword.exe).
    Please provide me some help.

    I may be wrong (and anyone, please correct me if so), but Java may not be the best tool for something such as this. I envision that you'd have to make some OS calls such as calls to the user32.dll, and while this can be done through the JNI, you'd still have to have a C or C++ program doing the dirty work.

  • Calling another application from a java program

    Hi, Java ppl.
    I wanted to know how can I call another program say a help application or an exe from a java program. anyone with any advice or a piece of code would help.
    Thanks
    Pradeep

    I had the same situation and I tried the code that you sugested and it works. I was wondering, what am I expecting in the while loop that appears after the int inp; statement? Is some data going to be displayed on the screen? How essential is to have that while loop after the calling the exec() method?
    Sorry for the amount of questions, I never tried this before.
    Best regards,
    Luis E.

  • HCM Processes & Forms : Employee start application from email

    Hi,
    In he SAP Online Help,
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/43/1d82283fce3566e10000000a11466f/content.htm
    it is documented (in the diagram) that it is possible for the employee role to start the form application from an email that contains a link to start the form application. May I know how the link can be retrieved and embeded in the content of the email, (presumably sent via workflow to the corporate email) ?
    Thank you.
    Regards
    Kir Chern

    Hi Joyce,
    Did you manage to resolve this? We have a similar requirement and are on EnP 3 as well. Is this something that you were able to achieve?
    Thanks.
    Regards,
    Akshay

  • How to open another application from a java programme

    How can I open some other application like "Textpad"
    from a java programme.
    Actually I want to open a particular java file in Textpad editor from my java programme.
    How Can I do that?
    Thanks

    Thanks for the code,
    I tried that but got this error
    java.io.IOException: CreateProcess: C://ProgramFiles/TextPad4/TextPad.exe D://Pi
    yush/BeanCreator/Parts.java error=3
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:64)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:272)
    at java.lang.Runtime.exec(Runtime.java:195)
    at java.lang.Runtime.exec(Runtime.java:152)
    at pack.CreateBean.CreateFile(CreateBean.java:327)
    Any idea!! What that means

  • Opening a java application from a java application

    I am trying to write a simple patching application for a program I am writing. The application must work on both Windows and Mac computers. The program is compiled into a single jar file. To patch the program, I'd like to see if an update is available, download the update if it's available and if the user requests it, and then apply the patch. Since this is a very simple, relatively small program, the "patch" is actually just a newer version of the jar file.
    I've haven't had any problems in detecting or downloading the updated jar file. The problem I'm having is that I can't overwrite the old jar file with the new one while the program is running (of course). Therefore, I wrote a separate patch program that does the actual downloading and replacing work. The order of operations should look like this:
    Open program -> Check for patch -> If user wants to patch then...
    Open patch application -> Close program -> Patch application downloads new jar file and replaces old jar file -> Open original program -> Close patch application.
    However, I can't seem to open the patch application from the original application. I'm using Runtime.getRuntime().exec("java -jar patchApp.jar") but I'm not getting any output whatsoever, neither the program running nor an exception. Can anyone suggest something here? Any help is appreciated.

    However, I can't seem to open the patch application
    from the original application. I'm using
    Runtime.getRuntime().exec("java -jar patchApp.jar")
    but I'm not getting any output whatsoever, neither the
    program running nor an exception. Can anyone suggest
    something here? Any help is appreciated.I've had bad results using the Runtime.exec method. It doesn't seem to be very reliable, at least not in Windows (that's probably not Java's fault.)
    Can you run java by just typing java at the console or do it have to be qualified. Make sure your patchApp.jar argument is in the correct case also.
    I gave up on exec and use JNI to delegate this task to native code. That's going to a little more complicated if you are running in two environemts.

  • Executing any other applications from a java application

    how can i execute or invoke other applications on the pc
    from a java application?

    Runtime.getRuntime().exec("dir");

  • Starting applications from a keynote via Apple Script?

    Is there any way to start an application from a keynote via Apple Script?

    Welcome to the forums!
    Keynote does not support the use of AppleScript in that fashion.

  • Start application from .dmg

    Hello
    I'm wondering what happens if you start up an application from a .dmg file. Will it also place preference files and the like on your Mac or will it just start without putting a single file on your Mac?
    And what kind of .dmg file should it be (read/write or dvd/cd master)?
    Thanks!

    Every user has a folder whose icon is represented by a House image on the sidebar when they are logged in as that user.    Those folders for all users are under:
    Macintosh HD -> Users
    The Desktop folder, the one that has your wallpaper and hard drive is under the home folder of the logged in user.
    So if your user is Guest,
    Macintosh HD -> Users -> Guest -> Desktop folder is the path to the wallpaper folder.
    In the Unix system, Macintosh HD, and any mounted disk, flash drive, or media is actually in
    /Volumes/Macintosh HD/
    So /Volumes/Macintosh HD/ is the actual path in Unix to your hard drive.
    and /Volumes/Macintosh HD/Users/Guest is the actual path to the guest folder.
    The Shared folder in the Users folder is one shared by all users on the hard drive.

Maybe you are looking for

  • Plz helP me about the new FW (software) v4.0750.31...

    plz help me i was update new FW v4.0750.31.2.1 but found too bugs in music player i cant save the preset and the sogs was download in memory always bad file when i play it. and the camera light is very little and not pure. plz I wanna the old version

  • I need to reinstall my photoshop elements 3

    I have a legally purchased Photoshop elements 3.0  which I  really like and use regularly.  I need to reinstall it and I keep getting the message that the  serial  number  is invalid.  I registered the product when I got  it it.    The number  am usi

  • Filtering of documents in KM

    Hi, I have created a repository in km, say, documents/demodocs in which user1 and user2 can add the documents. But the documents added by user1 should not be visible to user2 and vice-versa. How can I achieve this ? Helpful answers will be rewarded.

  • PhotoStream Shared Albums

    Hello!  I want to set-up a shared Photostream with a friend.  But this friend thinks that immediately he will not only see the photos that I put into this shared photostream for him to see, but also that I will then be able to see all his photos on h

  • Photoshop CC 2014 all brushes and erasers have jagged edges

    Okey so the problem is happening to my laptop (windows 8) I am using photoshop cc 2014. All my brushes and all of the erasers have jagged edges on soft brush and when I zoom in to 5000 I can clearly see that the edges is not 100% how they should be.