Results 1 to 2 of 2
  1. #1
    killerf2006 is offline Member
    Join Date
    Jul 2010
    Posts
    6
    Rep Power
    0

    Default How to run a jar file from a Button click in swing.

    Hi all,
    I'm new to this site and new to java programming.
    I have a doubt.
    Is it possible to run a jar file from a button click in swing.
    Help required in this. If possible can you post the code please.

    Thanks in advance.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,457
    Rep Power
    25

    Default

    run a jar file from a button click in swing
    Not sure what you are asking.
    You can run/execute a program from a java program by using the Process and Runtime classes. Create a command line to "run the jar file" and pass it to the methods of the above classes to execute it.

    Have the button listener start a thread to do the above.

    Swing has nothing to do with this problem.

Similar Threads

  1. Replies: 2
    Last Post: 11-03-2009, 05:11 PM
  2. How we can open a file with a click in button
    By kostinio in forum AWT / Swing
    Replies: 2
    Last Post: 11-01-2009, 04:46 PM
  3. Generate csv file on a button click
    By violeta in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-27-2009, 02:54 AM
  4. deselecting a button after the click.
    By ramsrocker in forum New To Java
    Replies: 10
    Last Post: 02-15-2009, 06:52 AM
  5. Swing - catching click button event
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-11-2008, 11: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
  •