The moose likes HTML, CSS and JavaScript and the fly likes what is the way of writing java code for converting into javascript? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "what is the way of writing java code for converting into javascript?" Watch "what is the way of writing java code for converting into javascript?" New topic
Author

what is the way of writing java code for converting into javascript?

Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1291

do we need to follow any specific way to writing a java code for converting in Javascript or ?

let say I need a function which returns me the time & Date in javacript.
in a simple way we write a main methods and use Date class of util package to get this.
code Example:


what would be the output of this program in javascript file by using GWT? is this file will convert into javascript?


Saifuddin..
[Linkedin] How To Ask Questions On JavaRanch My OpenSource
Prabhakar Chaganti
author
Ranch Hand

Joined: Nov 30, 2004
Posts: 50
You will need to follow the GWT way, as you will be using the Java to Javascript compiler provided by GWT to actually do the conversion. You will not be using main methods, but will instead use GWT modules and entry points.

thanks
prabhakar


Packt Author Page (http://www.packtpub.com/author_view_profile/id/120)
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1291

Originally posted by Prabhakar Chaganti:
You will need to follow the GWT way,


can you provide me any link of it,

Thanks in Advance.
Prabhakar Chaganti
author
Ranch Hand

Joined: Nov 30, 2004
Posts: 50
Try this:
http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.JavaToJavaScriptCompiler.html
 
 
subject: what is the way of writing java code for converting into javascript?
 
Threads others viewed
Date class - GeekWatch
Javascript and setting dates...
Change Timezone from GMT to EST, the best way to accomplish?
Executing Java at runtime
Interesting Anomaly with toString() vs. Memory Address
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com