Author Topic: can make ejs web java applet on click some button and full screen is shown?  (Read 7902 times)

lookang

  • Hero Member
  • *****
  • Posts: 1772
  • http://weelookang.blogspot.com
    • lookang web
can make ejs web java applet on click some button and full screen is shown.
 
i think it is a useful feature for Ejs java web applets, to be able to go full screen.

i realized NTNUJAVA allows drag to new location on the screen but the size is unchanged. if it can go fullscreen it will be useful for
projecting on the screen in classroom settings.

for your consideration:)

i try to do it but no success, maybe this URL helps
http://alecjacobson.com/programs/fullscreen-applet/

and it works here
http://alecjacobson.com/programs/fullscreen-applet/?page=http%3A%2F%2Fwww.phy.ntnu.edu.tw%2Fntnujava%2Findex.php%3Ftopic%3D539.0&code=&codebase=&path=

alecjacobson.com shared his php code here
http://www.alecjacobson.com/weblog/?p=148
<?php
  $applet = "";
  $code = "";
  if (isset($_GET['code'])&&strlen($_GET['code'])>0)
  $code = $_GET['code'];
  # remove surrounding quotes if given any
  $code = preg_replace("/["']$/","",$code);
  $code = preg_replace("/^["']/","",$code);
  # remove trailing .class just in case it's included
  $code = preg_replace("/.class$/","",$code);
  $codebase = "";
  if (isset($_GET['codebase'])&&strlen($_GET['codebase'])>0)
  $codebase = $_GET['codebase'];
  # remove surrounding quotes if given any
  $codebase = preg_replace("/["']$/","",$codebase);
  $codebase = preg_replace("/^["']/","",$codebase);
  $path= "";
  if (isset($_GET['path'])&&strlen($_GET['path'])>0)
  $path = $_GET['path'];
  if(empty($code)&&empty($codebase)&&!empty($path)){
  # stip out basename to get just the code's name
  $code = `basename $path`;
  $code = preg_replace("/
$/","",$code);
  # remove trailing .class just in case it's included
  $code = preg_replace("/.class$/","",$code);
  if(empty($codebase)){
  $codebase = `dirname $path`;
  # make the codebase look like a directory, not neccessary for all browsers
  $codebase = preg_replace("/
$/","/",$codebase);
  }
  $applet = "<applet width='100%' height='100%' code='$code' codebase='$codebase' ></applet>";
  }else if(!empty($code)&&!empty($codebase)){
  # remove trailing .class just in case it's included
  $applet = "<applet width='100%' height='100%' code='$code' codebase='$codebase' ></applet>";
  }
?>

to go full screen, i just key in URL of webpage with applet http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=539.0 as an example

automatically it captures
Code: users.ntnu.fkh.twopointcharges_pkg.twopointchargesApplet.class
Codebase: http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/2/
 
 
« Last Edit: August 10, 2011, 09:07:20 am by lookang »

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
What you did is change the applet code so that the size of applet is adjustable according to the browser window size.
It is not really full screen.

I can add this feature to all the applets in the web site easily if you think it is useful.
(i.e. add a link to popup a resizable window  with only applet in the window).

lookang

  • Hero Member
  • *****
  • Posts: 1772
  • http://weelookang.blogspot.com
    • lookang web
i do think it will be useful

1. to teachers in class using the simulations in the projector mode.
2. might be acceptable to Wikipedia external links http://en.wikipedia.org/wiki/Wikipedia:External_links which do not accept forums links, blog links, perhaps a full screen view is acceptable.
 
thanks!
it will be awesome when all NTNUJAVA applets can go almost full screen.
in most browser, when the key F11 is pressed, it will be even more full-screen :)
« Last Edit: August 10, 2011, 11:52:29 am by lookang »

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
It is done. You will find "full screen applet" link just below the applet.
Click the link and a new window will popup and the applet is sown in 100% browser size.

lookang

  • Hero Member
  • *****
  • Posts: 1772
  • http://weelookang.blogspot.com
    • lookang web
it is wonderful!
thanks again!  ;D