NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
November 23, 2017, 04:38:35 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  
"Wisdom is the harmony, healthy and happiness in life." ...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: How to add Java Source: Calc3.java into EJS ?  (Read 7914 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: January 07, 2009, 04:52:57 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

How to add Java Source: Calc3.java into EJS ?


reference: http://www.mste.uiuc.edu/users/exner/java.f/calc/
Arbitrary Precision Calculator

  Please click on the Calculator button to turn on the calculator.

  Error: Your browser is not java enabled.

Java Source: Calc3.java

1. Is there a import button?

2. Or is it a copy and paste into custom function ?

Thanks!
« Last Edit: January 08, 2009, 07:32:38 am by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: January 07, 2009, 11:14:28 pm »

You can add java functions into custom functions.

Actually, you can also add java class files or jar file.
You will find "additional libraries" button (to import jar or class) at custom page.

For example: EJS use many libraries from opensourcephysics project and other open source code.
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #2 on: January 08, 2009, 07:47:58 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

You can add java functions into custom functions.
Actually, you can also add java class files or jar file.
You will find "additional libraries" button (to import jar or class) at custom page.


1.  start a new file
2. navigate to custom page
3. right click for more options to import file.java that is saved in the workspace
4. though it say error in import
5. the is a button called set external java file so i select the file.java again
6. this time the code is imported
7. click RUN a red screen appear
8. what must be done to proceed to be able to build the interface or is it automatically since the external file.java seems to have draw syntax i think?

thanks

I attached the source.xml for easy reference Smiley








« Last Edit: January 08, 2009, 07:53:48 am by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #3 on: January 08, 2009, 09:05:31 pm »

The import button is for generated java .class  or .jar file (so called java byte code.),
It is not for java source code.

You have found a way to import java source.
But I thinj your example would not work. Because what you have imported is an applet. I do not know there is a way to add another applet inside another applet. (You can add drawingPanel inside another draeingPanel).
The java code you tried to import is a complete java applet. You can not put that inside an ejs applet.
You need to remove some of the code to make it work.

I was not able to try out your xml because you did not attach Calc3.java
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #4 on: January 08, 2009, 09:53:44 pm » posted from:Singapore,,Singapore

thanks for giving your time to explain this Grin

« Last Edit: January 08, 2009, 09:58:09 pm by lookang » Logged
Pages: [1]   Go Up
  Print  
"Wisdom is the harmony, healthy and happiness in life." ...Wisdom
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
how to develop the java applet for the circuit?
Comment about this web site!
4 18251 Last post March 02, 2005, 02:26:40 pm
by guest
can i have a superposition java appelet with more options
Wave
hesham 5 20025 Last post February 24, 2006, 10:58:04 am
by Fu-Kwun Hwang
Modifying a Java Applet
Request for physics Simulations
wallenx 4 9155 Last post March 24, 2008, 05:47:17 pm
by wallenx
please help me ,,, source code "java"
Electromagnetics
seemlave 1 6821 Last post January 12, 2009, 11:40:32 pm
by Fu-Kwun Hwang
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 5.055 seconds with 22 queries.since 2011/06/15