Can an Applet be Transparent or Given z-index?

J

JSJprogr

(this did not seem to make it, so I'll try again)
I have a web page that is a combo of a JavaScript drag-and-drop
program and a Java drawing applet. I want to be able to drap
the dragable divs (made dragable via JavaSCRIPT) over the applet
where line drawing is done. There would be 2 solutions, but I do
not know if either is possible or how to do them

(1) If I could make the applet transparent (except for the line drawings)
then the JS dragable gifs would drag to where I want them

OR

(2) If the applet could be put in a layer or div and given a z-index
or level, then the background of the applet need not be transparent,
I could drag the divs right OVER the part of the applet I wanted to.

If either of these solutions are possible, could someone tell me how?
 
N

Neomorph

(this did not seem to make it, so I'll try again)
I have a web page that is a combo of a JavaScript drag-and-drop
program and a Java drawing applet. I want to be able to drap
the dragable divs (made dragable via JavaSCRIPT) over the applet
where line drawing is done. There would be 2 solutions, but I do
not know if either is possible or how to do them

(1) If I could make the applet transparent (except for the line drawings)
then the JS dragable gifs would drag to where I want them

OR

(2) If the applet could be put in a layer or div and given a z-index
or level, then the background of the applet need not be transparent,
I could drag the divs right OVER the part of the applet I wanted to.

If either of these solutions are possible, could someone tell me how?

Nope. You can't really give an Applet an Alpha channel or something like
that. All you can do is make your Applet draw something in it that may look
exactly like it fits in its surroundings.

I have an Applet like that, but it only works on specific browser versions:
http://www.xs4all.nl/~leimann/javadev/glassApplet.html

http://www.xs4all.nl/~leimann/javadev/source/glass.zip
contains the source code, in case you're interested in implementation
details.

It basically uses Javascript access from Java to retrieve information about
its location on screen and uses the same background picture or color to
make it look like it's invisible (apart from its own animation).

It's currently limited to Netscape 4.x (under Windows - I had to make
assumptions about the widths of the lower and right hand window borders to
be able to figure out the Applet's position in the page) and IE 4.0
onwards, which provides enough positioning info through Javascript to get
it exactly right.

This means: the GlassApplet framework only works when Java and Javascript
are both enabled - if Javascript is disabled, but java is enabled you may
get an error, or the positioning will be incorrect (which for fine
granularity background patterns may not be a problem...).

Cheers.
 
T

Tim Tyler

: I have an Applet like that, but it only works on specific browser versions:
: http://www.xs4all.nl/~leimann/javadev/glassApplet.html

A funky chiquita you have there ;-)

: It's currently limited to Netscape 4.x (under Windows - I had to make
: assumptions about the widths of the lower and right hand window borders to
: be able to figure out the Applet's position in the page) and IE 4.0
: onwards, which provides enough positioning info through Javascript to get
: it exactly right.

I have a similar applet: http://cafaq.com/

However I never managed to get positioning info from Sun's JVMs under IE.

Do you know if you have managed that feat?
 
L

Liu, Chunyen

Did not seem to line up well in my IE 6.0 on Windows NT.

-----Original Message-----
From: Neomorph [SMTP:[email protected]]
Posted At: Friday, August 15, 2003 6:20 AM
Posted To: programmer
Conversation: Can an Applet be Transparent or Given z-index?
Subject: Re: Can an Applet be Transparent or Given z-index?

(this did not seem to make it, so I'll try again)
I have a web page that is a combo of a JavaScript drag-and-drop
program and a Java drawing applet. I want to be able to drap
the dragable divs (made dragable via JavaSCRIPT) over the applet
where line drawing is done. There would be 2 solutions, but I do
not know if either is possible or how to do them

(1) If I could make the applet transparent (except for the line drawings)
then the JS dragable gifs would drag to where I want them

OR

(2) If the applet could be put in a layer or div and given a z-index
or level, then the background of the applet need not be transparent,
I could drag the divs right OVER the part of the applet I wanted to.

If either of these solutions are possible, could someone tell me how?

Nope. You can't really give an Applet an Alpha channel or something
like
that. All you can do is make your Applet draw something in it that may
look
exactly like it fits in its surroundings.

I have an Applet like that, but it only works on specific browser
versions:
http://www.xs4all.nl/~leimann/javadev/glassApplet.html

http://www.xs4all.nl/~leimann/javadev/source/glass.zip
contains the source code, in case you're interested in implementation
details.

It basically uses Javascript access from Java to retrieve information
about
its location on screen and uses the same background picture or color
to
make it look like it's invisible (apart from its own animation).

It's currently limited to Netscape 4.x (under Windows - I had to make
assumptions about the widths of the lower and right hand window
borders to
be able to figure out the Applet's position in the page) and IE 4.0
onwards, which provides enough positioning info through Javascript to
get
it exactly right.

This means: the GlassApplet framework only works when Java and
Javascript
are both enabled - if Javascript is disabled, but java is enabled you
may
get an error, or the positioning will be incorrect (which for fine
granularity background patterns may not be a problem...).

Cheers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top