By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,237 Members | 1,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,237 IT Pros & Developers. It's quick & easy.

How to run a non Gui program when i click button in my gui program?

P: 4
Im having trouble on how to call another non GUI class and run it when I click the button inside my GUI program,I have two programs one is GUI and another is not.My problem is how to call a class of non gui program and the program will appear when i click the button inside my GUI program.Im not familiar of the code being used..
any advice will do..tnx

Biboy.
Mar 11 '13 #1

✓ answered by r035198x

So to compile it you use the compiler API as explained in the docs here: http://docs.oracle.com/javase/6/docs...aCompiler.html

Share this Question
Share on Google+
7 Replies


10K+
P: 13,264
If the other program is non GUI then what do you mean by "the program will appear when i click the button"?
Generally you add an actionListener to the button and call other methods from other classes there.
Mar 12 '13 #2

P: 19
Generally if you create an object of the 'non-GUI' class,
in response to Button Clicked Event that should suffice.
Mar 12 '13 #3

P: 4
sorry,I mean when i click a button inside my GUI the output of a non GUI program will compile, I want to compile my non-gui inside my Gui program when i Click the button, I already used actionListener and my problem is how to call methods and classes inside of it..Im just new in learning java,some codes were not yet familiar to me.
Mar 12 '13 #4

10K+
P: 13,264
Ok, where is the non GUI program stored that wants to be compiled? If the program is a Java program you can compile it from java using the compiler API from your action listener code.
Mar 12 '13 #5

P: 4
I stored it together with my Gui program in one folder..
Mar 12 '13 #6

10K+
P: 13,264
So to compile it you use the compiler API as explained in the docs here: http://docs.oracle.com/javase/6/docs...aCompiler.html
Mar 13 '13 #7

P: 4
ok thank you for the link and thank you by the way ;)
It helped me a lot.
Mar 13 '13 #8

Post your reply

Sign in to post your reply or Sign up for a free account.