Results 1 to 8 of 8
  1. #1
    Zazie is offline Member
    Join Date
    Jun 2014
    Posts
    13
    Rep Power
    0

    Default external programs on Java

    I want to create Java gui application.
    Now I want to include an external program like spell checking program.
    But I do not know how to do that it checked the text and identified the error if have.
    does anybody have an idea?

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,143
    Rep Power
    14

    Default Re: external programs on Java

    What exact external program are you trying to include? What exactly do you want it to do?

    You can't just add, say, minesweeper to your Java application. But if a program is meant to be used as a *library*, then it might give you an API that you can use simply by adding the library jars to your classpath.
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

  3. #3
    Zazie is offline Member
    Join Date
    Jun 2014
    Posts
    13
    Rep Power
    0

    Default Re: external programs on Java

    External program is binary executable (made from Fortran).
    Is it possible to call such a binary executable (made from Fortran) by Java?

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: external programs on Java

    Yes, using Runtime.exec() or the Process class.

    When Runtime.exec() won't | JavaWorld
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    Zazie is offline Member
    Join Date
    Jun 2014
    Posts
    13
    Rep Power
    0

    Default Re: external programs on Java

    for example like this?

    import java.io.IOException;

    public class RunExeMain {

    //This is Example that display how to run exe using java
    public static void main(String args[])
    {
    String filePath = "cmd /c start E:\\zchex\\danlow.exe";
    try {

    Process p = Runtime.getRuntime().exec(filePath);

    } catch (Exception e) {
    e.printStackTrace();
    }

    }
    }

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: external programs on Java

    Read more of the article, not only the first page.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    Zazie is offline Member
    Join Date
    Jun 2014
    Posts
    13
    Rep Power
    0

    Default Re: external programs on Java

    is it possible to run an external program in JFrame?

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: external programs on Java

    KevinWorkman already said no. Your operating system runs the 'external program', not Java.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Run Java Programs
    By StevenR in forum New To Java
    Replies: 2
    Last Post: 02-20-2013, 09:33 AM
  2. How to launch two Java programs?
    By 260191894 in forum Advanced Java
    Replies: 1
    Last Post: 07-10-2012, 10:51 PM
  3. Open external file with external program
    By Wietse de Vries in forum New To Java
    Replies: 1
    Last Post: 12-31-2011, 04:52 PM
  4. Run external programs using runtime class
    By JBird in forum New To Java
    Replies: 3
    Last Post: 08-06-2009, 02:37 AM
  5. executing external programs
    By Levish2002 in forum AWT / Swing
    Replies: 0
    Last Post: 09-10-2008, 07:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •