Java Global Question
Hello all,
My (first ;)) question is:
How do I write two seperate applications and make one of them run the other (similar to calling executeables in VB)
I hope my question is clear enough...
Thanks ahead for your help!
[251 byte] By [
pym] at [2007-11-11 8:50:48]

# 1 Re: Java Global Question
not sure if you simply mean calling a different class fromthe one you are in!
if so do this
public void DifClass()
{
NewClass b=new Newclass();
b.Start();//function in class Newlass
}
any code in NewClass is ran before control is handed back to first class
alexz at 2007-11-11 22:34:17 >

# 2 Re: Java Global Question
First, thanks for your answer, Alex.
I know I can use another class, instantiate it and call a method to run it.
But that's not what I meant.
Since I am newbie with Java, I may not understand the concept...
Let me try to describe the question better.
I have one Java application written by someone.
I want his application (which I can't alter the code in), to use my GUI application (that I still need to write ;))
Now how do I tell him to "run" my application.
In VB / C++, I would create my own EXE / DLL and hand it to him with a known interface or command line.
In Java, there are no executables nor DLLs as far as I understand.
So how do I integrate my code into his code :confused:
Hope it's more clear this time :o
Thanks!!!
pym at 2007-11-11 22:35:11 >

# 3 Re: Java Global Question
Take a look at the Runtime class, especially the exec methods.
If you want to communicate with the program you launch, or capture its output, look at the Process class.
nspils at 2007-11-11 22:36:15 >
