Results 1 to 6 of 6
  1. #1
    kemiga is offline Member
    Join Date
    Jul 2011
    Posts
    3
    Rep Power
    0

    Default Can I launch a program from a Java application?

    I don't even know where to post this thread so I chose this forum since I'm relatively new to Java!

    I have created a GUI with Java with tabs and buttons etc. with various pieces of information on each page. What I would like to know is: is it possible to create a button or link of some sort which launches a whole new program from a Java application?

    If this is possible I'd really appreciate tips on how to actually do it!

    Thank you for reading

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,587
    Rep Power
    25

    Default

    See the Runtime and Process and Desktop classes for ways to launch another process from a java program.

  3. #3
    kemiga is offline Member
    Join Date
    Jul 2011
    Posts
    3
    Rep Power
    0

    Default

    Thank you for your quick reply. I've looked up various tutorials on the things you suggested but they all seem to be if you want to see the output in the console.

    What I've got is a java GUI in which I want to have a button that, when pressed, launches another application. I think runtime might be that which I'm supposed to use but I can't find anything on how to use it within a GUI and assign it to a button or anything!

  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Just have an action listener which will launch the process when clicked.

    Running system commands in Java applications | java exec example | devdaily.com

    Googling for "running processes in java" shows plenty of stuff.

  5. #5
    kemiga is offline Member
    Join Date
    Jul 2011
    Posts
    3
    Rep Power
    0

    Default

    Thanks, I'll try that!

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

Similar Threads

  1. Launch Jar from in application
    By hardcorebadger in forum New To Java
    Replies: 3
    Last Post: 01-25-2011, 07:03 AM
  2. Not able to launch J2ME application
    By vishal21 in forum CLDC and MIDP
    Replies: 2
    Last Post: 12-02-2010, 03:58 PM
  3. Not able to launch J2ME application
    By vishal21 in forum Sun Java Wireless Toolkit
    Replies: 1
    Last Post: 11-23-2010, 02:14 AM
  4. Java Application fails to launch without error
    By javaguy78 in forum AWT / Swing
    Replies: 9
    Last Post: 11-16-2010, 07:25 PM
  5. Replies: 1
    Last Post: 05-17-2010, 10:03 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
  •