We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › how to launch the applet only when the user decide
Page Index Toggle Pages: 1
how to launch the applet only when the user decide (Read 1265 times)
how to launch the applet only when the user decide
Oct 24th, 2006, 11:30pm
 
hello and sorry for the bad english (i speak french)
i want to do a Web page about brownian diffusion but i'd like the applet launch itself only after a click on an icon (processing icon for example). Of course i don't want to open a new window with the applet (i know how to do) but i want java work only when the user décide. is it possible ?
i hope explanations were clear...

you could see the test page : http://perso.ensc-rennes.fr/jimmy.roussel/index.php?page=java1&bug=no

best regards

Jimmy
Re: how to launch the applet only when the user de
Reply #1 - Oct 25th, 2006, 11:17am
 
I think you could do this with javascript, and an <iframe>.

When the page loads the iframe shows a blank page, but clicking on the icon runs some javascript that stes the iframe's location to a page with the applet on it.
Re: how to launch the applet only when the user de
Reply #2 - Feb 23rd, 2007, 11:59am
 
Code:
<html>
<head>
<title>Brownian Diffusion</title>
</head>
<body>

<?php

if(isset($_GET['start'])){
 echo '<embed src blah blah blah...>';
 echo '<more applet init code, blah blah..>';
} else {
 echo '<a href="index.php&start">Start Applet</a>';
}

?>

</body>
</html>


it may be php, but that's as simple as it gets. :)

edit: this can also be modified with about 15 lines of ajax code (depending on your ajax wrapper) to have only a portion of the page refresh, such as an iframe or a span.
Re: how to launch the applet only when the user de
Reply #3 - Feb 23rd, 2007, 12:10pm
 
well, i feel like a moron. you found a very nice way to do it on your page, i see, and it involves no special scripting languages of any kind. Smiley
Re: how to launch the applet only when the user de
Reply #4 - Feb 23rd, 2007, 12:49pm
 
http://appletobject.org/

http://appletobject.org/index.php?q=examples

we're still working on this ... and it will eventually become part of processing in the future (export to web).

F

oh, and here's the report on that:
http://dev.processing.org/bugs/show_bug.cgi?id=491

and some old discussion:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1168878870
Page Index Toggle Pages: 1