Exec() Help!  
Author Message
Dafydd Monks





PostPosted: 2004-4-13 5:12:00 Top

java-programmer, Exec() Help! Hi,

I'm trying to start an external applet from an applet I'm writing. I know
Exec() Is the key, but I don't know how to use it. I know how to execute
external native programs (I.e. programs I have written in BASIC and
compiled). But starting an applet from an applet totally throws me. I have
tried searching the net, and that has a lot to say about executing shell
scripts, and natives - which I know how to do.

What classes do I need to import? what line of code invokes an external
applet? I don't need to grab output from the applet I want to execute, or
send input. I just want it to run.

Pleeeeeeez can anyone help, my project has to be handed in soon :-(

Thanks,

Dafydd.


 
Dafydd Monks





PostPosted: 2004-4-13 6:17:00 Top

java-programmer >> Exec() Help! God bless you! you're a star!

Now I can finish my project and go and watch TV! *Studenty grin*

Dafydd.

Roedy Green <email***@***.com> wrote in message
news:email***@***.com...
> On Mon, 12 Apr 2004 22:12:13 +0100, "Dafydd Monks"
> <email***@***.com> wrote or quoted :
>
> >But starting an applet from an applet totally throws me. I have
> >tried searching the net,
>
> You can't start an applet, but you could start an application, with an
> exec of
> java.exe mypackage.MyClass
>
> For how you turn an Applet into an application see
> http://mindprod.com/jgloss/applet.html
>
> --
> Canadian Mind Products, Roedy Green.
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


 
Dafydd Monks





PostPosted: 2004-4-13 8:05:00 Top

java-programmer >> Exec() Help! One more thing.....

In my applet main is static (it has to be) but init is not (with the code
I'm using, it can't be) so when I use your code snippet, I get a "cannot
make static connection to a non static method"

Any ideas?

Sorry for all this newbie stuff - I've only been coding Java for a month,
and I've found myself writing a 1000 line applet/application!

Dafydd.

Roedy Green <email***@***.com> wrote in message
news:email***@***.com...
> On Mon, 12 Apr 2004 22:12:13 +0100, "Dafydd Monks"
> <email***@***.com> wrote or quoted :
>
> >But starting an applet from an applet totally throws me. I have
> >tried searching the net,
>
> You can't start an applet, but you could start an application, with an
> exec of
> java.exe mypackage.MyClass
>
> For how you turn an Applet into an application see
> http://mindprod.com/jgloss/applet.html
>
> --
> Canadian Mind Products, Roedy Green.
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


 
 
Dafydd Monks





PostPosted: 2004-4-14 6:49:00 Top

java-programmer >> Exec() Help! Silly me - I meant applet into Application.

Thanks for all the help,

Dafydd.


Roedy Green <email***@***.com> wrote in message
news:email***@***.com...
> On Tue, 13 Apr 2004 01:05:12 +0100, "Dafydd Monks"
> <email***@***.com> wrote or quoted :
>
> >In my applet main is static (it has to be) but init is not (with the code
> >I'm using, it can't be) so when I use your code snippet, I get a "cannot
> >make static connection to a non static method"
>
> use Java web start.
>
> Create an object THEN use init.
>
> The code snippet I gave is for turning a functioning Applet into an
> application, not the reverse.
>
> You manually have to refactor you application to turn it into an
> Applet.
>
> --
> Canadian Mind Products, Roedy Green.
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.