From: Roedy Green on
On Fri, 08 May 2009 09:13:40 -0700, Mark Space
<markspace(a)sbc.global.net> wrote, quoted or indirectly quoted someone
who said :

>Dirk Bruere at NeoPax wrote:
>> Is it possible to download a Java app (applet etc?) and run it inside a
>> desktop Java app?
>>
If you know the name at compile time, you just invoke the method as
if it were part of the original program. Just make sure the jar is on
the classpath.


If you don't know the name, and you just have a String you concocted
at run time, you can use Class.forName and newInstance. See
http://mindprod.com/jgloss/classforname.html

If you don't even know the method names and parameters at compile
time, you need to use reflection.
http://mindprod.com/jgloss/reflection.html
--
Roedy Green Canadian Mind Products
http://mindprod.com

Responsible Development is the style of development I aspire to now. It can be summarized by answering the question, �How would I develop if it were my money?� I�m amazed how many theoretical arguments evaporate when faced with this question.
~ Kent Beck (born: 1961 age: 49) , evangelist for extreme programming.