How do I set a Date to a javascript object, using Java?

I am using Java and Eclipse. For one part of my project, I needed to write a calendar, so I decided to use already written (on javascript) callendar -

I have written a method that initialize the js component:

private static native void initComponent()/*-{

The problem is that I dont know how to populate the date. I tried something like:

private static native void setStartDate(Date date)/*-{

But it didnt work.

Can I have some suggestions: what I have did right/wrong, what to google?


You can't use another programming language just inline in the Java code. Despite it's name, JavaScript has not much in common with Java.

If you really want to integrate both, you could do so using the Java Scripting API but that is going to be tough.

Need Your Help

Pure Data for music composition?

generator hidden-markov-models puredata

I am currently working on a project where a Classical Music Generator is set to be built. A lecturer who is pretty much a expert in sound processing suggested that I could construct a Hidden Markov...

tomcat isolate webapps

java tomcat jvm

multiple webapp running on same tomcat using same jvm. sometime, one webapp that have memory leak will cause entire jvm to crash and affect other webapps. any recommendation how to isolated that wi...