NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
December 13, 2017, 08:21:41 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  
Know the universe as yourself and you can live anywhere in comfort. ...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
  Print  
Author Topic: how to make slider with fixed values for instance 1,2,5,10 50  (Read 7232 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Fred Chuit
Newbie
*
Offline Offline

Posts: 18



«
Embed this message
on: January 19, 2009, 07:55:10 pm » posted from:Meppel,Drenthe,Netherlands

Dear EJS-users,

I am looking for an input device (slider-type) from which a user can pick fixed values,
for instance: 0.1 , 1 , 2, 5, 10, 50, 100.

Is something like this possible in EJS?

Already thanks for any help of advice.
Regards,
Fred
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: January 19, 2009, 08:36:11 pm »

Registed user can get files related to this applet for offline access.
Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
If java program did not show up, please download and install latest Java RUN TIME

It is the same question for all programming language/environment (not restricted to EJS).
It always be possible. But the problem is how to let user understand how to use it easily.

Set up a label on top of a slider to display " 0.1, 1, 2, 5, 10,50,100",
And add a slider under it for integer value property: for example id (range from 0-6 for the above values).
 then add the following code :
switch(id){
 case 0: x=0.1; break;
 case 1: x=1.0; break;
 case 2: x=2.0; break;
....
}
May be you can add another text string to display value for x.

You should be able to find different way to do it.



Registed user can get files related to this applet for offline access.
Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
If java program did not show up, please download and install latest Java RUN TIME
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #2 on: January 20, 2009, 09:23:48 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

it is incredible. cool. amazing
Logged
Pages: [1]   Go Up
  Print  
Know the universe as yourself and you can live anywhere in comfort. ...Lao Tzu (570-490 BC)
 
Jump to:  


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.354 seconds with 23 queries.since 2011/06/15