Results 1 to 7 of 7
  1. #1
    benedums is offline Member
    Join Date
    Aug 2007
    Posts
    1
    Rep Power
    0

    Default Launch native app inside a JFrame???

    I know it's possible to launch an application from java but is it possible to launch an application and have it open as a JInternalFrame or similar inside a JFrame?

    Here is the code for executing a command line arg.

    public static void execute(String filePath){
    try{
    (Runtime.getRuntime()).exec(filePath);
    } catch (IOException e) ;
    }
    Could you cast the runtime as a process and add that to an internal frame or jpanel? Not sure how that would work though...:confused:

    Anyone have an idea how to do this?
    Or if this is even possible?

  2. #2
    levent Guest

    Default

    I think this is impossible..

  3. #3
    telepresence is offline Member
    Join Date
    Feb 2011
    Posts
    3
    Rep Power
    0

    Default

    Was going to start a new thread, but then found this one. This is exactly what I am trying to figure out how to do. I haven't used Java and was trying to brush up and learn a little more. I'd like to construct a cross-platform desktop environment I could put on a thumbdrive and run on any system with java installed. I thought, though, that it would be good if I still had access to the programs on the system, but I'd want them to run along side of the ones in my desktop environment layer. Did you ever figure out how to open native applications inside of a JFrame?

  4. #4
    NRitH is offline Senior Member
    Join Date
    Feb 2011
    Posts
    118
    Rep Power
    0

    Default

    You probably can display the native app in a Java app, but I'll bet it's more trouble than it's worth. First, you don't want to have your Java app launch the native process; instead, you should use JNI to write a wrapper around your native code so that it can be controlled from within your Java code. Second, you'll have to muck around with java.awt.Toolkit and the java.awt.peer.* classes to create a peer that's hooked up to the native view.

  5. #5
    telepresence is offline Member
    Join Date
    Feb 2011
    Posts
    3
    Rep Power
    0

    Default

    Maybe this will be a little easier then: how can I do the same thing, but with a 3rd party .jar or .class file? Meaning how can I open a java program with a gui inside of another java program's JFrame or JDesktopPane?
    Last edited by telepresence; 02-24-2011 at 02:05 PM.

  6. #6
    NRitH is offline Senior Member
    Join Date
    Feb 2011
    Posts
    118
    Rep Power
    0

    Default

    Quote Originally Posted by telepresence View Post
    Maybe this will be a little easier then: how can I do the same thing, but with a 3rd party .jar or .class file? Meaning how can I open a java program with a gui inside of another java program's JFrame or JDesktopPane?
    That's easy. Include the third-party jar or class on your app's classpath, then instantiate the third-party app inside your program, and add its top-level GUI component to your own.

  7. #7
    telepresence is offline Member
    Join Date
    Feb 2011
    Posts
    3
    Rep Power
    0

Similar Threads

  1. string inside of a xml
    By Heather in forum XML
    Replies: 2
    Last Post: 03-28-2008, 05:21 PM
  2. Class inside an Interface
    By $hr!k@nt in forum New To Java
    Replies: 1
    Last Post: 12-21-2007, 10:56 AM
  3. launch a desktop icon program command
    By avaj987 in forum New To Java
    Replies: 3
    Last Post: 08-03-2007, 11:40 AM
  4. How to call JSP inside Servlet
    By Swamipsn in forum Advanced Java
    Replies: 0
    Last Post: 07-31-2007, 12:50 PM
  5. actionErrors inside of Action
    By Jack in forum JDBC
    Replies: 2
    Last Post: 07-04-2007, 03:31 AM

Posting Permissions

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