NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
December 11, 2017, 08:24:46 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  
Never underestimate others. Never overestimate oneself. ...Wisdom
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: Physlets Electric field lines one positive and one negative charge java applet  (Read 19494 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Moderator
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
on: August 13, 2008, 10:14:50 pm »

http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=730.msg2704#new





Physlets®, i.e., the Java applets themselves, are a registered trademark of Wolfgang Christian.


* chargeunlike.PNG (16.25 KB, 710x533 - viewed 422 times.)
« Last Edit: August 20, 2009, 02:20:44 pm by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: August 15, 2008, 12:07:04 am »

Simulations created with Physlet library need javascript to generate actions.
You can not just add applet tag(It would not work, unless you did not need to add any objects or actions).
Please check out the html source from generated physlet simulations and you will find those javascript code.
And when you submit message, the forum  will change line break(RETURN:which is not visible) into html line break code.
So (RETURN) will add some code in the applet tag or javascript. You will need to remove it.
And the physlet classes are located at "/classes/" at this web site.




Click in the simulation regin to draw field line which will pass the click point.
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #2 on: August 15, 2008, 07:45:28 am »

http://home.phy.ntnu.edu.tw/~lookang/Physletbuilder/Efieldgeneratedbyonepositiveandonenegativecharge.html

PS:
i have to delete this applet here, cos only can display one Smiley


Please check out  Electric field structure and Field lines for two point charges +/- for similar applet created with EJS.

« Last Edit: August 15, 2008, 10:41:43 am by lookang » Logged
jeff_forssell
teacher/web course designer
Newbie
*
Offline Offline

Posts: 11


environment, computers, gardening, politics, Africa


WWW
«
Embed this message
Reply #3 on: August 15, 2008, 01:59:55 pm »

I may be "knocking down an open door" but I just want to point out that many of the Physlet applets can be used even without Javascript code. in the applet on this page there is the
<param name="ShowControls" value="false">
If that is set to "true" instead, the page visitor will see a control panel and be able to create and change objects.

But the true power of Physlets is the ability to create situations that can be easily manipulated (by the visitor pressing a button or changing a value) to show the things one wants to show.
Logged

jeff forssell
Http://home.bip.net/jeff.forssell
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #4 on: August 15, 2008, 04:49:32 pm » posted from:Taipei,T'ai-pei,Taiwan

Yes. I am agree with that "Physlet can be created without javascript".
Advanced user can use it to manually generate different kind of simulations.
Logged
lookang
Moderator
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #5 on: August 15, 2008, 10:56:47 pm »

is it possible to create custom control checkbox to show (true/false) for global properties like field lines, forces etc ?

currently, when i enable the control, the default control appears
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #6 on: August 15, 2008, 11:47:34 pm »

The physlet is a java library designed to be controled with java-script.
So you can add java-script to add different effect you want.
You will need to know about basic javascript coding and you also need to read physlet document to know what javascript functions are available. (You can download/view document from physlet home site).

Let me know you some examples: (I also add the same code to the first message.)

Check out the above physlet applet after you click the button.

If you click edit checkbox in the simulationBuilder page.
You will find out the javascript code being generated with that builder.
The builder only support basic functions in physlet library. Many complicated functions were not implemented with the builder (Because I create the builder for beginner to create simple simulation. And I do not have time to create complicate graphical user interface--- I am not a professional programmer.)
Logged
lookang
Moderator
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #7 on: August 16, 2008, 08:23:07 am »

amazing... i followed your scripts to make this!

« Last Edit: August 16, 2008, 08:24:41 am by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #8 on: August 16, 2008, 08:57:54 am »

Good! you are a quick learner!
The beauty of physlet is to be able to use javascript to change different behavior at run time.
Actually, you can also use javascript to call build in functions or user defined functions (or variables) in EJS generated simulations to change simulation at run time.
Logged
lookang
Moderator
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #9 on: August 20, 2008, 03:57:10 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

The codebase in the applet tags point to the URL for browser to find java classes files.
And javascript can use the nameor id tag in the applet to referer to applet.

value for the name is :Efield2
and the following javascript:
fkh2=document.Efield2;
will referer to the applet.
So fkh2.setAutoRefresh(false); will execute setAutoRefresh function defined in the applet.

Why there is no reference of the url of http://home.phy.ntnu.edu.tw/~lookang/Physletbuilder/Efieldgeneratedbyonepositiveandonenegativecharge.html ?.. is this calling my files ? or is it part of your website library ?

Thanks! Grin


Quote
var timerID2=0; function initApplets2(){ clearTimeout(timerID2); loaded2=true;timerID2=setTimeout("init2()",100);}function init2(){fkh2=document.Efield2;fkh2.setAutoRefresh(false);fkh2.setDefault();id1=fkh2.addObject("charge","x=-0.2,y=0,q=-1,r=10");fkh2.setShowFieldLines(true);id2=fkh2.addObject("charge","x=0.2,y=0,q=1,r=10");fkh2.setLabel(id1,"-");fkh2.setLabel(id2,"+");fkh2.setAutoRefresh(true);} <applet width="640" height="480" code="eField4.EField.class" codebase="/classes/" archive="EField4_.jar,STools4.jar" align="baseline"  name="Efield2" mayscript>
i remove the script and applet tags because even in code tags, the applet appears and jam (prevent the top applet from working properly) the top applet Cry
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #10 on: August 21, 2008, 10:25:14 pm » posted from:Nicosia,Nicosia,Cyprus

codebase="/classes/"

Mean it is using library at the same web site(where the web page is located!).
 If you want to use library at other web site  you need to add something like
codebase="http://home.phy.ntnu.edu.tw/~lookang/classes/"

Each applet should have it's own name , if you add another applet tag with the same name in your previous post, the browser did not know which one to act on. That is the reason why it was not working.

You need to write special code to show applet tag instead of insert another applet into the message.

type & lt; (without space between & and lt;)to show <
Logged
lookang
Moderator
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #11 on: August 25, 2008, 10:20:38 pm » posted from:Mountain View,California,United States

so it is using your jar files!!

i tried to link up with mine in http://home.phy.ntnu.edu.tw/~lookang/classes/

i cannot understand why it works on my pc but after uploaded onto the http://home.phy.ntnu.edu.tw/~lookang/classes/ it didn't work anyway.

i suspect the files names changed the need to change Efield_.jar from EField_.jar Grin
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #12 on: November 11, 2008, 08:58:28 pm »

http://home.phy.ntnu.edu.tw/~lookang/classes/ does not exist.
but http://home.phy.ntnu.edu.tw/~lookang/Physletbuilder/classes/ exists.
You did not provide the correct file path.
Logged
Pages: [1]   Go Up
  Print  
Never underestimate others. Never overestimate oneself. ...Wisdom
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Electric field structure and Field lines for two point charges +/-
Electromagnetism
Fu-Kwun Hwang 20 28047 Last post October 09, 2010, 10:37:18 pm
by Fu-Kwun Hwang
Physlets Electric field lines generated by two positive charges java applet
Collaborative Community of EJS
lookang 0 8789 Last post August 18, 2008, 03:44:31 pm
by lookang
Physlets Electric field lines generated by two negative charges java applet
Collaborative Community of EJS
lookang 0 12205 Last post August 18, 2008, 09:30:37 pm
by lookang
Physlet Electric field lines one positive & one negative charges java applet
Collaborative Community of EJS
lookang 4 10505 Last post November 06, 2009, 11:18:41 pm
by Fu-Kwun Hwang
Electric field structure and Field lines for two point charges +/-
electromagnetism
ahmedelshfie 1 5070 Last post April 27, 2010, 08:22:26 pm
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.067 seconds with 23 queries.since 2011/06/15