| Author |
JButton that runs another Java program
|
Jack Joneson
Greenhorn
Joined: Mar 23, 2009
Posts: 2
|
|
Hello all.
I am currently working on a Java project that is due to be completed soon (so I may have a few questions at a later date). Admitedly, I'm not very good at programming and much of my code so far is a bit of a mish mash of stuff that I have found by searching the net.
I have a program that runs correctly in DOS with a few changes I need to make at a later date.
I also currently have a GUI that displays as I would like it to. However, I am at the stage of adding Action Events and cannot find too much help elsewhere.
I have my jbuttons and one of these, when clicked on, I want it to run the other program I have created. The output of this program is a text file and I would like it to be possible to open this text file when a 2nd jbutton is clicked on.
Is this possible and any pointers?
Thanks
|
 |
pete stein
Bartender
Joined: Feb 23, 2007
Posts: 1561
|
|
It's hard to know what to advise you as I can't guess the structure of any of your programs. Your best bet may be to study about JButtons and creating ActionListeners at the Sun Swing tutorial site here:
Writing an Action Listener
How to use Buttons
The Really Big Index
Also, is the program that you want to "run" a true class with a constructor and non-static methods, or is it mainly a static main method-type program. I think that if you supply us with more information you'll likely get more specific help.
|
 |
 |
|
|
subject: JButton that runs another Java program
|
|
|