Is it possible to download a Java app (applet etc?) and run it inside a desktop Java app? -- Dirk http://www.transcendence.me.uk/ - Transcendence UK http://www.theconsensus.org/ - A UK political party http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
Dirk Bruere at NeoPax wrote: > Is it possible to download a Java app (applet etc?) and run it inside a > desktop Java app? > Quite likely, but you won't necessarily get the same security model, unless you were careful about it. -- Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
Dirk Bruere at NeoPax wrote: > Is it possible to download a Java app (applet etc?) and run it inside a > desktop Java app? > Yes, you can just download the code and run it. There are Jar classes for manipulating this. <http://java.sun.com/javase/6/docs/api/java/util/jar/JarFile.html> You may need to use a Classloader as well, I haven't actually tried this.
Mark Space wrote: > Dirk Bruere at NeoPax wrote: >> Is it possible to download a Java app (applet etc?) and run it inside >> a desktop Java app? >> > > > Yes, you can just download the code and run it. There are Jar classes > for manipulating this. > > <http://java.sun.com/javase/6/docs/api/java/util/jar/JarFile.html> > > You may need to use a Classloader as well, I haven't actually tried this. > > Take a look here and the next page in this series. It might help: <http://java.sun.com/docs/books/tutorial/deployment/jar/jarclassloader.html>
On Fri, 08 May 2009 14:03:53 +0100, Dirk Bruere at NeoPax <dirk.bruere@gmail.com> wrote, quoted or indirectly quoted someone who said : >Is it possible to download a Java app (applet etc?) and run it inside a >desktop Java app? Very easy. All you need is Class.forName See http://mindprod.com/jgloss/classforname.html -- Roedy Green Canadian Mind Products http://mindprod.com "Species evolve exactly as if they were adapting as best they could to a changing world, and not at all as if they were moving toward a set goal." ~ George Gaylord Simpson
On Fri, 08 May 2009 14:03:53 +0100, Dirk Bruere at NeoPax <dirk.bruere@gmail.com> wrote, quoted or indirectly quoted someone who said : >Is it possible to download a Java app (applet etc?) and run it inside a >desktop Java app? It is easy if there is some cooperation, the add on implements an interface. Harder if not. Then you need reflection. See http://mindprod.com/jgloss/reflection.html -- Roedy Green Canadian Mind Products http://mindprod.com "Species evolve exactly as if they were adapting as best they could to a changing world, and not at all as if they were moving toward a set goal." ~ George Gaylord Simpson
Dirk Bruere at NeoPax wrote: > Is it possible to download a Java app (applet etc?) and run it inside a > desktop Java app? Sure. That is what Andrew does in http://pscode.org/appleteer/ ! Arne
Roedy Green wrote: > On Fri, 08 May 2009 14:03:53 +0100, Dirk Bruere at NeoPax > <dirk.bruere@gmail.com> wrote, quoted or indirectly quoted someone who > said : >> Is it possible to download a Java app (applet etc?) and run it inside a >> desktop Java app? > > It is easy if there is some cooperation, the add on implements an > interface. Harder if not. Given that apps has a static main method and applets extend either Applet or JApplet, then an interface should not be needed. Arne
On May 9, 8:28=A0am, Arne Vajh=F8j <a...@vajhoej.dk> wrote: > Dirk Bruere at NeoPax wrote: > > > Is it possible to download a Java app (applet etc?) and run it inside a > > desktop Java app? > > Sure. > > That is what Andrew does in http://pscode.org/appleteer/ ! Yep. To the OP: Note that AppletViewer is also a 'Java desktop app.', and is what Sun uses to launch webstart based applets, and the new 'draggable applets' if they are dragged off the web page. (whispers) Appleteer is better, though. ;-) -- Andrew T. pscode.org
On May 8, 11:03=A0pm, Dirk Bruere at NeoPax <dirk.bru...@gmail.com> wrote: > Is it possible to download a Java app (applet etc?) and run it inside a > desktop Java app? For the first part, get an URLClassLoader that points to the applet. Here is a simplistic* SSCCE that does the second part. <http://forums.sun.com/thread.jspa?messageID=3D10259860#10259860> * Trouble starts if the applet uses parameters, does not have a preferred size, uses any of the applet context methods.. I am a bit confused by your use of 'Java app (applet etc?)' what else besides an applet are you looking to run? -- Andrew T. pscode.org
On Fri, 08 May 2009 09:13:40 -0700, Mark Space <markspace@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.
![]() |
0 |
![]() |