This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JButton that runs another Java program Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "JButton that runs another Java program" Watch "JButton that runs another Java program" New topic
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JButton that runs another Java program
 
Similar Threads
Please need help with calculator program...
Hiding a JFrame using a Submit button?
best way to program expiry date
WebPage to Applet to WebPage to Java
Calling method in Java App from Jython