• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JButton that runs another Java program

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic