NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
May 01, 2016, 01:24:11 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  
Teaching without words. ...Lao Tzu (570-490 BC)
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
Author Topic: Ejs Open Source Stop Watch Model Java Applet  (Read 9760 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Hero Member
Offline Offline

Posts: 1775


Embed this message
on: August 15, 2011, 02:39:23 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

Ejs Open Source Stop Watch Model Java Applet by dhasthagheer, added on by Fu-Kwun Hwang, and now slightly remixed by lookang

Embed a running copy of this simulation

Embed a running copy link(show simulation in a popuped window)
Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
  • Please feel free to post your ideas about how to use the simulation for better teaching and learning.
  • Post questions to be asked to help students to think, to explore.
  • Upload worksheets as attached files to share with more users.
Let's work together. We can help more users understand physics conceptually and enjoy the fun of learning physics!

* Ejs_Open_Source_Stop_Watch_Model_Java_Applet.png (34.75 KB, 508x534 - viewed 306 times.)
« Last Edit: September 08, 2011, 03:51:33 pm by lookang » Logged
Hero Member
Offline Offline

Posts: 1775


Embed this message
Reply #1 on: August 15, 2011, 02:48:09 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

combined the magnification function into the main frame instead of the dialog by Fu-Kwun to allow a one view of the magnification.
mouse x and mouse y = x and y respectively to allow on click to select region to magnify.
created code to force mouse screen from going too far
if (x >10)x = 10; // prevent magnifer from going beyond
if (x <-10)x = -10;
if (y >10)y = 10;
if (y <-10)y = -10;
i learn to make magnification
by changing the
xmin = x - ratio;
xmax = x + ratio;
ymin = x - ratio;
ymax = y + ratio;
which is something i always wanted to do, but could not figure out the codes in this kind of exact implementation.
will try to put in the vernier and micrometer soon.
move the RESET button to the right of the strop watch face for right handers.
created play setp and reset button to use simulation in addition to the screen press on button.
added color scheme to suit printing on paper for school use
change text to ARIAL 30 second text bigger
change text ARIAL 20 minutes text bigger
16 august 2011
add text using l_t= (int)(Math.floor(t/60))+" minute(s) & "+ (Math.round(((10*t)%600))/10.) + " second(s)";
17 august 2011
// String.format("%8.2f\n",0.912385) // for decimal places will give 0.91 in dp
// String.format("%.5g%n", 0.912385); // for significant figures will give 0.91 in sign fig
17 august 2011 night
add slider for minute and seconds and the associated controls
add answer Boolean
added "game" for time to be random for self assessment for learning
made the feedback appear only after input from user
if (showAnswerFlag==false)
A1correct = "";
A2correct = "";
  if (Math.abs(minute - enterA1) <= 0.5) {
   A1correct = "Great! You have the right answer!";
   A1correctbackground = java.awt.Color.GREEN;
  else {
   A1correct = "Your input is out by "+ String.format("%1.1f\n",(minute-enterA1 ));
   A1correctbackground = java.awt.Color.RED;
  if (Math.abs(second - enterA2) <= 0.05) {
   A2correct = "Great! You have the right answer!";
   A2correctbackground = java.awt.Color.GREEN;
  else {
   A2correct = "Your input is out by "+ String.format("%1.1f\n",(second-enterA2 ));
   A2correctbackground = java.awt.Color.RED;


made the start stop button fit to screen by making it a bit smaller
18 august 2011
made the drop down menu for ds = 0.1,0.2,0.5,1
checkbox for integer display of the minute hand to address possible misconception thanks to feedback from Søren ⎈⎝⏠⏝⏠⎠∰ Kyale on facebook
19 august 2011
made the hands a bit shorter to show the lines as aligned and not overlap for clearer visuals
made the random() to (int) to integer seconds for ease of gaming.

01 September 2011
added calibrate button from http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=990.0 to tell the time actually from
java.util.GregorianCalendar Calendar=new java.util.GregorianCalendar();
StopwatchDegreeSecond = Calendar.get(Calendar.SECOND)*6.+Calendar.get(Calendar.MINUTE)*6*60.;

04 September 2011
made the calibrate time follow dt = 0.05 and fps = 20 to imitate real time seconds following http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=990.0
add this option to the combo drop-down list

08 September 2011
made the hands drag-gable and correctly corresponding show the time using http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=990.0 as reference
made the magnify only when show==true
if (show ==true) // to make magnify enable only after show ==true
improve the codes for displaying the numbers in exact format
//l_t= (int)(Math.floor(t/60))+" minute(s) & "+ String.format("%1.1f\n", t%60) + " second(s)";
l_t= _view.format(Math.floor(t/60),"00")+" minute(s) & "+ _view.format(t%60,"00.0") + " second(s)";

to do if time permits
http://stopwatch.onlineclock.net/ like the digital number display
http://geogebrawiki.wikispaces.com/DIY+of+Stopwatch example of a stopwatch in geogebra

it appears that no many stop watch java applets around. this is indeed new knowledge

original simulation is by dhasthagheer! thanks for sharing Smiley
magnification is by Fu-Kwun Hwang. thanks for the enhanced features which dhasthagheer wanted.
remixed with changes above in this simulation is by lookang Smiley

* Ejs Open Source Stop Watch Model Java Applet.png (21.69 KB, 507x532 - viewed 257 times.)

* stopwatch.jpg (36.88 KB, 500x467 - viewed 672 times.)

* Ejs_Open_Source_Stop_Watch_Model_Java_Applet.png (34.75 KB, 508x534 - viewed 214 times.)

*** There are 1 more attached files. You need to login to acces it!
« Last Edit: September 08, 2011, 03:55:36 pm by lookang » Logged
Pages: [1]   Go Up
Teaching without words. ...Lao Tzu (570-490 BC)
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Ejs Open Source Bar Magnet Model java applet
Simulations from other web sites
ahmedelshfie 2 6883 Last post April 26, 2010, 07:48:35 pm
by ahmedelshfie
Ejs Open Source Earth and Moon Model
Collaborative Community of EJS
lookang 23 15083 Last post August 02, 2011, 03:39:39 pm
by lookang
EJS open source code Circular Well Superposition Model
Simulations from other web sites
ahmedelshfie 1 3311 Last post July 07, 2010, 08:09:40 pm
by ahmedelshfie
Ejs Open Source 2D Collision Model java applet
Collaborative Community of EJS
lookang 1 9327 Last post May 19, 2011, 10:56:16 pm
by lookang
Ejs Open Source Sound Travel FireWorks Model
Collaborative Community of EJS
lookang 1 3957 Last post August 10, 2011, 04:51:02 pm
by lookang
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.055 seconds with 23 queries.since 2011/06/15