NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 18, 2017, 12:56:38 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  
Life well spent is long. ..."da Vinci (1452-1519, Italian artist, sculptor, painter, architect, engineer and scientist) "
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: can the interface - field - format show special characters like alpha  (Read 17778 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
on: August 13, 2007, 08:40:38 am » posted from:Singapore,,Singapore

hihi,

please advise how can i get the symbol alpha to display under the format of a field 2.0.


original result it shown as 


i keyed in the α into the format, before compling looks correct


after compling, a ? appears in place of α


thanks for helping  Grin
« Last Edit: August 13, 2007, 08:50:16 am by lookang » Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #1 on: August 13, 2007, 08:55:07 am » posted from:Singapore,,Singapore

attached is my xml.

thanks!
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #2 on: August 13, 2007, 12:10:23 pm »

It works on my computer. May be your computer did not support such font?
Please check out the attached file.


* alpha.png (59.74 KB, 509x344 - viewed 244 times.)

* alpha.png (55.56 KB, 507x345 - viewed 246 times.)

* alpha2.png (18.91 KB, 316x336 - viewed 250 times.)
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #3 on: August 13, 2007, 12:42:20 pm » posted from:Singapore,,Singapore

interesting!!!

i will try at home later.

by the way, can i download your  xml file to see if it works on this pc Smiley

thanks
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #4 on: August 13, 2007, 01:28:31 pm »

File is attached!


*** There are 1 more attached files. You need to login to acces it!
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #5 on: August 13, 2007, 01:39:44 pm » posted from:Singapore,,Singapore

i am in a dilemma.

I think the problem is the pc here.

the alpha (in your system) is display as some funny thing (pound sign and a stroke) on this pc.

I will try to sort things out on my end.

thanks for your help Smiley

« Last Edit: August 13, 2007, 01:42:41 pm by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #6 on: August 13, 2007, 02:31:35 pm »

It is related to character coding system used in the operating system.
Because I used Chinese operating system, the character code is not unisersal for those special characters(fonts).
Unless it was translated into UTF-8 code, otherwise, you would not be able to see it correctly.
 
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #7 on: August 13, 2007, 11:19:19 pm » posted from:Singapore,,Singapore

i tried using TT fonts , seems to work.

the closest match the alpha i can find is this one.

don't seems to work if i use those O fonts on the interface text field.

any tips ? Cheesy
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #8 on: August 13, 2007, 11:22:25 pm »

I do not understand what do you mean by
"using TT fonts, seems to work. ... don't seems to work if i use those O fonts on the interface text field."
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #9 on: August 13, 2007, 11:29:16 pm » posted from:Singapore,,Singapore

i was experiment with true type fonts TT, the pound sign work!!, then i tried others, seems to work


i previously tried those with O , because alpha symbol is from say times news roman. It seems the text field can't recognise the true alpha symbol in java text field.

am i on the right track ?

the pictures may explain what is O(not sure what it means) and TT(true type)
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #10 on: August 14, 2007, 12:02:33 am »

I found out how to make it from the web search.
The String value for alpha is "\u03B1"

So if you define s="\u03B1=2.3"; as a variable in the ejs model and asign s to variable for text field
It should display as what you want. Please check out the attached file.
And it should work for all the operating system.

You can find the unicode for other characters from Unicode Character Search


*** There are 1 more attached files. You need to login to acces it!
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #11 on: August 14, 2007, 12:31:34 am » posted from:Singapore,,Singapore

thanks for help.

i understand the idea about making it to strings.

but i think i do it for the plotting panel only.

EJS keep hanging on me when i tried to change the field_old 1.0 to take the string.

2 times already.

appreciate the help, this idea i going to use it on the plotting panel to show the angle with a polygon.

my next design improvement Cheesy
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #12 on: August 14, 2007, 07:45:58 am » posted from:Singapore,,Singapore

i did it!!

thanks prof hwang for the idea of using text field , i horizontal box with the field.

in the variable for text field %alphasymbol%

alphasymbol is defined as a string in the declaration as "\u03B1"

thanks for your advice.

BTW

my xml file is getting big ~100 kb, soon i will be unable to upload the xml here.
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #13 on: August 14, 2007, 07:56:22 am » posted from:Singapore,,Singapore

supporting pictures of what i meant.

for the rest learning from forum.
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #14 on: August 14, 2007, 01:02:05 pm » posted from:Taipei,T'ai-pei,Taiwan

thanks for help.

i understand the idea about making it to strings.

but i think i do it for the plotting panel only.

EJS keep hanging on me when i tried to change the field_old 1.0 to take the string.

2 times already.

appreciate the help, this idea i going to use it on the plotting panel to show the angle with a polygon.

my next design improvement Cheesy

You should be able to use the same technique for the textString GUI element (to be added into the PlottingPanel).
Check out the EjsConsole, it will provide information about run time error to know why the ejs was hanging.
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #15 on: December 04, 2008, 10:46:25 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

found another way to draw symbol in EJS thanks to http://www.compadre.org/OSP/document/ServeFile.cfm?ID=8243&DocID=881 Rocket Car on an Inclined Plane Model
written by Wolfgang Christian, Francisco Esquembre, and Mario Belloni

I look at the source code and realise how they implement:

Quote
$\\beta$
by changing beta to gamma , alpha , theta

interesting huh?

for your info

BTW the text $\\beta$
dollarsign\\betadollarsign cannot display
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #16 on: December 04, 2008, 04:55:28 pm » posted from:Taipei,T'ai-pei,Taiwan

It is because this forum will display mathematic equation if you put some TeX syntax between dollar sign.
For example:
$ \alpha+ \beta +\Gamma $
will display
\alpha+ \beta +\Gamma
(It is similar to what will be display in EJS when you type equations in TeX format.  Because EJS code was compiled with java , so you need to add two backslashes to translate into one backslashes during the java string processing.)

You can also use _ and ^ to get subscript and superscript effect (and many more TeX mathematic equation features.)

If you want to display dollar sign, please add a backslash in front of dollar sign.
\$
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #17 on: December 04, 2008, 05:10:51 pm » posted from:Singapore,,Singapore

that's cool! will try next time!
Logged
Pages: [1]   Go Up
  Print  
Life well spent is long. ..."da Vinci (1452-1519, Italian artist, sculptor, painter, architect, engineer and scientist) "
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
multiple display most easy user interface
Questions related to EJS
lookang 4 8344 Last post August 23, 2007, 10:43:58 am
by lookang
Rod Approach to special relativity
Request for physics Simulations
balasai09 1 7011 Last post February 06, 2009, 03:30:49 pm
by Fu-Kwun Hwang
Hi/board:29-100 (Question about EJS GUI/ modified by Fu-Kwun Hwang)
Question related to Physics or physics related simulation
ahmedelshfie 2 4412 Last post January 14, 2010, 11:44:35 pm
by Fu-Kwun Hwang
boolean state of displaying characters is not process in 3Djava on load
Questions related to EJS
lookang 0 2604 Last post June 17, 2010, 01:02:17 pm
by lookang
this is how to make display show in scientific format 0.00E00 like tracker
Questions related to EJS
lookang 2 4335 Last post August 11, 2010, 08:05:48 am
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.143 seconds with 22 queries.since 2011/06/15