Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Can an Applet be Transparent or Given z-index?

Reply
Thread Tools

Can an Applet be Transparent or Given z-index?

 
 
JSJprogr
Guest
Posts: n/a
 
      08-14-2003
(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?



 
Reply With Quote
 
 
 
 
Neomorph
Guest
Posts: n/a
 
      08-15-2003
On 14 Aug 2003 21:25:23 +0200, JSJprogr <(E-Mail Removed)>
two-finger typed:

>(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.
 
Reply With Quote
 
 
 
 
Tim Tyler
Guest
Posts: n/a
 
      08-22-2003
Neomorph <(E-Mail Removed)> wrote:

: 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?
--
__________
|im |yler http://timtyler.org/ http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
Liu, Chunyen
Guest
Posts: n/a
 
      08-22-2003
Did not seem to line up well in my IE 6.0 on Windows NT.


> -----Original Message-----
> From: Neomorph [SMTP:(E-Mail Removed)]
> 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?
>
> On 14 Aug 2003 21:25:23 +0200, JSJprogr
> <(E-Mail Removed)>
> two-finger typed:
>
> >(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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Has thought been given given to a cleaned up C? Possibly called C+. Casey Hawthorne C Programming 385 04-04-2010 02:11 AM
Can Groovy be used in an applet and/or can it generate the Java bytecodes that then can be used in an applet? Casey Hawthorne Java 1 03-18-2009 12:56 AM
" Given BACK what was freely GIVEN " 2Barter.net C++ 0 12-13-2006 02:56 AM
Days in a given date range for a given month......... Lord0 Java 1 04-19-2006 04:54 PM
generate all possible strings of given length given a set of characters chiara C Programming 6 10-06-2005 01:43 AM



Advertisments