NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 17, 2017, 11:37:30 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  
"Vision, mission and action." ...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: Photoelectric  (Read 8972 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
ahmedelshfie
Ahmed
Hero Member
*
Offline Offline

Posts: 954



«
Embed this message
on: November 17, 2010, 07:03:12 pm » posted from:SAO PAULO,SAO PAULO,BRAZIL

Hello prof
Photoelectric java applet written by Jose Ignacio Fernández Palop.
URL download applet http://www.compadre.org/osp/items/detail.cfm?ID=10272
I don't know how i add the images in applet I'm talk about images that added in applet by variables , i don't know how i add this images i never use this way to add images in easy java simulation.
Could you explain how i add images by this way in EJS.
I already attach image to applet and the jar file too.
Thanks


* Photoelectric.gif (42.09 KB, 707x537 - viewed 782 times.)

*** There are 1 more attached files. You need to login to acces it!
« Last Edit: November 17, 2010, 07:06:30 pm by ahmedelshfie » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: November 17, 2010, 08:39:22 pm » posted from:,,Taiwan

There is a "image File" property for user to select image file from your local file system.
It will use image file in _data/reset1.gif if the value for "image File" is "./_data/reset1.gif"

You can define a String in EJS variable panel.
e.g. Name=image, type=String, Initial value="./_data/reset1.gif"
then assign value for "image File" as "%image%"
EJS will find value from "image" and load the file.

You can change value of "image" with java code.
Code:
e.g. If (x>10 ) image="./_data/reset1.gif";
else image="./_data/reset2.gif";
However, you will have to make sure both files are available.

You should add both files as "User files" from "Run option" panel. (check out attached file)


It is the same feature for property value in EJS GUI elements.
You can enter value or enter a variable name. 
However, for String type property, the value is a string, so variable name are enclosed by "%" pair.

For the attached jar file:The following code were used.
Code:
if(sodio){
  material = "photoelectric/sodio.gif";
  potencialcorte = 2.28;
}
else{
  material = "photoelectric/cesio.gif";
  potencialcorte = 2.1;
}
and the image property was assigned with value="%material%"


* image.jpg (85.1 KB, 587x547 - viewed 311 times.)
Logged
ahmedelshfie
Ahmed
Hero Member
*
Offline Offline

Posts: 954



«
Embed this message
Reply #2 on: November 17, 2010, 11:24:37 pm » posted from:SAO PAULO,SAO PAULO,BRAZIL

Thanks prof
I have just one comment about ./ when i add this in code and variable panel ejs print message Required files not found
So l delete ./ and change to "_data/photoelectric/0.gif" i also delete from code ./ to become like it
Code:
if(sodio){
   material = "_data/photoelectric/sodio.gif";
   potencialcorte = 2.28;
}
else{
   material = "_data/photoelectric/cesio.gif";
   potencialcorte = 2.1;
}
So after run applet work fine and message not appear again i didn't know what the reason, but now is work fine!
 

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!
« Last Edit: November 17, 2010, 11:26:16 pm by ahmedelshfie » Logged
Pages: [1]   Go Up
  Print  
"Vision, mission and action." ...Wisdom
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Photoelectric effect
Modern Physics
Fu-Kwun Hwang 18 88149 Last post April 10, 2015, 07:41:17 am
by Femida
Photoelectric Effect Java Applet modeling e*Vs = h*f - W
Request for physics Simulations
lookang 2 8309 Last post July 14, 2009, 11:13:31 am
by lookang
Photoelectric effect
modern physics
ahmedelshfie 1 6831 Last post May 17, 2010, 05:15:43 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.058 seconds with 23 queries.since 2011/06/15