NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
December 17, 2017, 06:55:57 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
"There is nothing either good or bad, but thinking makes it so." ..."Shakespeare (154-1616, English dramatist and poet) "
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: can make ejs web java applet on click some button and full screen is shown?  (Read 6250 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
on: August 10, 2011, 07:55:24 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

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
Code:
<?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(\"/\n/","",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("/\n/\",\"/\",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/
 
 


* fullscreen.png (120.62 KB, 1279x925 - viewed 324 times.)
« Last Edit: August 10, 2011, 08:07:20 am by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: August 10, 2011, 10:21:16 am » posted from:Taipei,T'ai-pei,Taiwan

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).
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #2 on: August 10, 2011, 10:40:55 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

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 Smiley
« Last Edit: August 10, 2011, 10:52:29 am by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #3 on: August 10, 2011, 01:56:36 pm » posted from:Taipei,T'ai-pei,Taiwan

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.
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #4 on: August 10, 2011, 02:49:37 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

it is wonderful!
thanks again!  Grin


* fullscreenNTNU.png (49.05 KB, 1024x768 - viewed 322 times.)
Logged
Pages: [1]   Go Up
  Print  
"There is nothing either good or bad, but thinking makes it so." ..."Shakespeare (154-1616, English dramatist and poet) "
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
how to make the symbol "alpha" appear as α in the java applet
Questions related to EJS
lookang 2 13030 Last post August 13, 2007, 07:48:56 am
by lookang
is it possible to make applet make a sound when i condition is met?
Questions related to EJS
lookang 8 10485 Last post December 22, 2008, 12:10:01 pm
by lookang
how to make the left right button to vary x? for all modes
Questions related to EJS
lookang 6 8253 Last post June 03, 2009, 08:57:04 pm
by Fu-Kwun Hwang
Request for converging lens ray diagram with an adjustable screen
Request for physics Simulations
leeyiren 8 13421 Last post January 12, 2010, 11:12:28 am
by Fu-Kwun Hwang
How make applet run one time only/board:23-100-
Question related to Physics or physics related simulation
ahmedibrahim 4 4515 Last post July 17, 2010, 12:35:45 am
by ahmedelshfie
Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.076 seconds with 23 queries.since 2011/06/15