Can an Applet be Transparent or Given z-index?

Discussion in 'Java' started by JSJprogr, Aug 14, 2003.

  1. JSJprogr

    JSJprogr Guest

    (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?
     
    JSJprogr, Aug 14, 2003
    #1
    1. Advertising

  2. JSJprogr

    Neomorph Guest

    On 14 Aug 2003 21:25:23 +0200, JSJprogr <>
    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.
     
    Neomorph, Aug 15, 2003
    #2
    1. Advertising

  3. JSJprogr

    Tim Tyler Guest

    Neomorph <> 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/
     
    Tim Tyler, Aug 22, 2003
    #3
  4. JSJprogr

    Liu, Chunyen Guest

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


    > -----Original Message-----
    > From: Neomorph [SMTP:]
    > 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
    > <>
    > 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.
     
    Liu, Chunyen, Aug 22, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lord0
    Replies:
    1
    Views:
    581
    Thomas Weidenfeller
    Apr 19, 2006
  2. chiara
    Replies:
    6
    Views:
    490
    Barry Schwarz
    Oct 6, 2005
  3. 2Barter.net
    Replies:
    0
    Views:
    380
    2Barter.net
    Dec 13, 2006
  4. Tomasz Chmielewski

    sorting index-15, index-9, index-110 "the human way"?

    Tomasz Chmielewski, Mar 4, 2008, in forum: Perl Misc
    Replies:
    4
    Views:
    321
    Tomasz Chmielewski
    Mar 4, 2008
  5. Raymundo
    Replies:
    5
    Views:
    148
    Keith Thompson
    Aug 31, 2009
Loading...

Share This Page