NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Information about this web site => Question related to Physics or physics related simulation => Topic started by: ahmedelshfie on June 16, 2010, 06:29:45 pm



Title: Ask about buttom MenuItem 
Post by: ahmedelshfie on June 16, 2010, 06:29:45 pm
Prof Hwang i have ask about buttom MenuItem for example i want use code _alert for me typing
Information's in java message not in help tool so i want typing alto of information's how i make information's in code _alert
No appear in one line because is alto of information's if appear in one line will be have a long information and monitor of PC cant display because
Is long information's so how i put information's down one by one
I will attach image about layout text but information's in one line because is not alto is just example for make my ask more clear


Title: Re: Ask about buttom MenuItem 
Post by: Fu-Kwun Hwang on June 16, 2010, 10:58:34 pm
Do you want to show a popup window(like the attached image)? Or you just need some string on top of the simulation?


Title: Re: Ask about buttom MenuItem 
Post by: ahmedelshfie on June 16, 2010, 11:15:04 pm
This is good too but when i modified simulation airdrag i add up last thing is help
And explain every tool in simulation and what him job so when you press by mouse on any explain
from help appear another window this window that we use code _alert("Easy Java Simulations","Ahmedelshfie","for explain about x shown us position of mass ,and what is job of x")
Is a example so prof information's that i want typing after ahmedelshfie in place of "for explain about x shown us position of mass ,and what is job of x"
Is allot when i typing appear in one line but monitor of PC can display because line is long
My idea if have away to but information's in alert massage like this for example:
hit PLAY to experiment start at (0,0) again while keeping,
the previous sets of data points,
bottom panel hit RESET to restore back to initial state of the applet,
to start a new experiment, used for a new experiment.

And appear alert massage that i attach image like it ?
I mean line down another


Title: Re: Ask about buttom MenuItem 
Post by: Fu-Kwun Hwang on June 17, 2010, 01:26:33 pm
I see. What you need is a line break.

Just add "\n" to break the line.

Add the following line (in one line))as the third parameter for _view._alert
Code:
hit PLAY to experiment start at (0,0) again while keeping,\nthe previous sets of data points,\nbottom panel hit RESET \nto restore back to initial state of the applet,\nto start a new experiment, used for a new experiment.
Please check out preview applet as example (click alert button).


Title: Re: Ask about buttom MenuItem 
Post by: ahmedelshfie on June 17, 2010, 05:31:26 pm
Yes prof this what i want and i test is work very well
Thank you so much or your help you the hero


Title: Re: Ask about buttom MenuItem 
Post by: lookang on June 17, 2010, 07:15:59 pm
hi ahmedelshfie
is this correct?(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1835.0;attach=3027;image)
I thought u wanted 2 lines ?


Title: Re: Ask about buttom MenuItem 
Post by: ahmedelshfie on June 17, 2010, 07:27:14 pm
No my ask was about code _view_alert and typing message but i have a lot of information's
So i ask prof Hwang About what code broken line and he answer me is \n i test and work very well
By the way prof lookang i notice in projectile motion in tool help up you typing information's by one line have some monitor cant display
Because line is long so you need a code to broken line to 3 parts for example for monitor of PC display because size for example size my monitor is large may 17 or 21
But have users use monitor 15 or on laptop ,notebook so code \n broken line