473,386 Members | 1,602 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Combining applets and javascript

Hi.

I'm playing around with developing a web-based application that needs
to use a java applet in order to implement some advanced functionality
that I don't see as being feasible with pure javascript (it involves
dynamically drawing and editing vector graphics).
My initial design has the workspace area where the vector graphics are
drawn AND the toolbars needed to interact with it both done inside the
applet. The problem with this is that at least one of the toolbar
commands needs to cause the browser to load another web page, which I
don't believe is possible*. It does however seem quite feasible to
have the toolbars implemented in client-side javascript, such that each
button sends a command to the applet. I've tested this and it works
fine under IE6/Java 1.5, and I assume it should work with most
java-enabled browser platforms. In that case there's no problem having
some of the toolbar commands do things such as load another web page.
But are there any known disadvantages to doing it this way? Does
anyone have any experience trying to do this sort of thing? My
toolbars use transparent gifs and some are "toggle buttons", that stay
down once clicked - I'm not sure if there are any issues implementing
these with JavaScript. Obviously it's possible to have some toolbars
done in JavaScript and others be part of the applet, but I'd prefer not
to have to do this if possible.

* There appears to be something called "LiveConnect" that does support
this, but on the one web page I found demonstrating it, it didn't work.

Feb 17 '06 #1
3 1384
On 16 Feb 2006 17:55:46 -0800, wi******@hotmail.com wrote, quoted or
indirectly quoted someone who said :
The problem with this is that at least one of the toolbar
commands needs to cause the browser to load another web page, which I
don't believe is possible*.


there is "Applet.showDocument, but often it does nothing. It is
considered dangerous.

If the web page is under your control and is vanilla HTML 3.1 with
bugs, you can dodge them and render in a JTextPane or JTextEditor.

see http://mindprod.com/jgloss/jtextpane.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Feb 17 '06 #2
On 16 Feb 2006 17:55:46 -0800, wi******@hotmail.com wrote, quoted or
indirectly quoted someone who said :
It does however seem quite feasible to
have the toolbars implemented in client-side javascript, such that each
button sends a command to the applet


Or vice versa. You can share the work between the JavaScript and the
Java, passing information back and forth. JavaScript is good for
"cheating" and special browser interactions. Java is good for heavy
duty stuff.

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Feb 17 '06 #3

Roedy Green wrote:
On 16 Feb 2006 17:55:46 -0800, wi******@hotmail.com wrote, quoted or
indirectly quoted someone who said :
It does however seem quite feasible to
have the toolbars implemented in client-side javascript, such that each
button sends a command to the applet


Or vice versa. You can share the work between the JavaScript and the
Java, passing information back and forth. JavaScript is good for
"cheating" and special browser interactions. Java is good for heavy
duty stuff.

In the end I got LiveConnect going (via the netscape.javascript
package). It works very nicely under IE 6 and Java 1.5, so I'm hoping
it works under most Java-enabled browser environments.
It's easier to keep the toolbars inside the Java application, as I
can't see any easy way to implement image-buttons in Javascript that
draw as standard buttons as per the environment's windowing system (you
seem to have to provide an image of the whole button, as opposed to
just the icon inside).

Feb 19 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brian | last post by:
Hi All, Can someone please point me in the right direction I am having problems combining JS and ASP. What I am trying to do is store in a database using ASP the referring page of my visitors. ...
40
by: Eitan | last post by:
Hello, I know Java-Applet (written for JBuilder). I would like to know about dotnet technology, pros and cons in comparation to Java-Applet technololgy. Can I write a program in dotnet, like...
12
by: Wladimir Borsov | last post by:
On one of my web pages there is an java applets which works fine on my computer. However I noticed on some other computer that the run of java applets are disabled. I got an error message...
4
by: Neil Cherry | last post by:
I've seen references to using <applets ... > and document.applets to access public Java functions from Javascript. Do I still use document.applets with <object ...>? BTW, the FAQS page seems to...
3
by: alwayswinter | last post by:
I currently have a form where a user can enter results from a genetic test. I also have a pool of summaries that would correspond to different results that a user would enter into the form. I...
1
by: Kevin C. | last post by:
I'm going to write a client-side web app that deals with local files. This web app targets mainly public or corporate browser terminals. Normally I would write an Applet because that's what I know...
0
by: Jonathan Seidner | last post by:
Hi, I know there is a way to embed a .net control into a web page using the object tag. this object's properties and methods can then by accessed by javascript code in the html page. what i'm...
8
by: jason.m.ho | last post by:
>From the common user perspective (like my grandma), why would they care if its a java applet or an ajax application? Say I want to make a chat system on my website...If i'm doing really involved...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.