Results 1 to 16 of 16
  1. #1
    alacn's Avatar
    alacn is offline Senior Member
    Join Date
    Jun 2010
    Location
    UK. near London
    Posts
    118
    Rep Power
    0

    Default Is it possible to run an exe inside a JFrame?

    As the title says. I know how to load jar files into an applet but is it possible to load an exe file inside a container?
    Teaching myself java so that i can eventually join the industry! Started in June 2010

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    If you mean display a GUI application inside of a Swing container, then I think it's possible, but would require an existing third party library or some heroic JNI coding.

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,772
    Rep Power
    25

    Default

    To run an .exe from a java program see the Process and Runtime classes.

    I don't know what this part of the question means:
    is it possible to load an exe file inside a container?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Since he's saying "inside a container" I'm assuming that he wants to display a GUI from within a Java container, but as he doesn't clarify this statement further, any interpretation is possible.

  5. #5
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,772
    Rep Power
    25

    Default

    It takes a crystal ball to see what an OP is asking for. We try to give him all the interpretations we can think of and let him chose one.

  6. #6
    alacn's Avatar
    alacn is offline Senior Member
    Join Date
    Jun 2010
    Location
    UK. near London
    Posts
    118
    Rep Power
    0

    Default

    sorry i thought i was clear, Fubarable was right in understanding me.

    to use an example. Lets say i wanted to launch mspaint.exe from within my java code and then display mspaint.exe inside my applet.
    Teaching myself java so that i can eventually join the industry! Started in June 2010

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  8. #8
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,772
    Rep Power
    25

    Default

    display mspaint.exe inside my applet.
    I guess you mean that all the screen I/O GUI from the mspaint program is to be captured by the applet and channeled into the applet's area of the screen.
    Interesting concept. Definitely a native code project.

  9. #9
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,727
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Norm View Post
    I guess you mean that all the screen I/O GUI from the mspaint program is to be captured by the applet and channeled into the applet's area of the screen.
    Interesting concept. Definitely a native code project.
    Just imagine all the power if you could run any program inside your own gui component; that would imply that your prgogram can run itself entirely within one of its own visual components ...

    kind regards,

    Jos ;-)

  10. #10
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,772
    Rep Power
    25

    Default

    Like a bunch of mirrors into infinity?

  11. #11
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,727
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Norm View Post
    Like a bunch of mirrors into infinity?
    Yep, any kind of recursion will do; what the OP asked for cannot be done.

    kind regards,

    Jos

  12. #12
    alacn's Avatar
    alacn is offline Senior Member
    Join Date
    Jun 2010
    Location
    UK. near London
    Posts
    118
    Rep Power
    0

    Default

    the mirror thing is interesting. Im assuming this can be done with class loader and imported .jar files?
    Teaching myself java so that i can eventually join the industry! Started in June 2010

  13. #13
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    Default

    I think you missed this
    Quote Originally Posted by JosAH View Post
    what the OP asked for cannot be done.
    db

  14. #14
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,772
    Rep Power
    25

    Default

    Im assuming this can be done with class loader and imported .jar files
    What do those have to do with an exe file?

  15. #15
    alacn's Avatar
    alacn is offline Senior Member
    Join Date
    Jun 2010
    Location
    UK. near London
    Posts
    118
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    What do those have to do with an exe file?
    nothing, im just taking a deeper look at the miroring concept
    Teaching myself java so that i can eventually join the industry! Started in June 2010

  16. #16
    alacn's Avatar
    alacn is offline Senior Member
    Join Date
    Jun 2010
    Location
    UK. near London
    Posts
    118
    Rep Power
    0

    Default

    Quote Originally Posted by Darryl.Burke View Post
    I think you missed this


    db
    no i saw it, he was refering to exe's not jar files, and so the question is not related to that response.
    Teaching myself java so that i can eventually join the industry! Started in June 2010

Similar Threads

  1. Launch native app inside a JFrame???
    By benedums in forum Advanced Java
    Replies: 6
    Last Post: 02-25-2011, 04:23 PM
  2. Replies: 3
    Last Post: 07-14-2010, 11:34 PM
  3. Switching JPanels inside JFrame attempt
    By frenk_castle in forum AWT / Swing
    Replies: 7
    Last Post: 03-31-2010, 09:39 AM
  4. How to add JFrame inside JPanel
    By niteshwar.bhardwaj in forum Java 2D
    Replies: 8
    Last Post: 12-13-2009, 09:41 PM
  5. Centering inside a JFrame
    By kahaj in forum AWT / Swing
    Replies: 9
    Last Post: 09-23-2009, 08:23 PM

Posting Permissions

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