Re: How to make a JFrame Transparent



moumitaghosh@xxxxxxxxxxxxxxx wrote:

Thanks for ur solution.

Thank me by leaving a little of earlier text, like I do.

..Actually my problem is i'm trying to create an
assistant(just like MS office) ..

?? Don't run it.

..which i can place and move on my JFrame
application.

Placing a transparent thing over your own application is much easier, since a) You can provide a snapshot of the underlying components, b) You do not need to paint the transparent components in a Root level container, but over the *top* of one.

You can see the effect of text hovering over this ScreenSaver
preview, in the first few seconds on the upper left..
'StarZoom Saver'..
<http://www.javasaver.com/testjs/jws/04/starzoom.jnlp>

At first i placed another JFrame on my application,which shows the
assistant.But the problem was,it was not transparent.

So simply draw your semi-transparent components floating in a JPanel over the top of the application..

I think the GlassPane might be appropriate for that, but
I have usually overridden paint/paintComponent by this stage
in any case.

--
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
.



Relevant Pages

  • Re: GDI and image displays
    ... Tim Wilson ... > underlying original one shows through the 'transparent' parts and I want ... >> So you're drawing one image and then you want to change and draw another ... >> Paint event handler, then you just need to cause a refresh using, as one ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Transparent BG for loaded Image
    ... >> have it as BufferedImage. ... >> but with it's background beeing transparent. ... > paint over which). ... > using the Graphics2D object. ...
    (comp.lang.java.programmer)
  • Re: What control is being painted?
    ... Transparent meant they would not paint a background colour, ... > color set in their parents BackColor property. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What control is being painted?
    ... Transparent meant they would not paint a background colour, ... > color set in their parents BackColor property. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Transparent BG for loaded Image
    ... > have it as BufferedImage. ... Then that part of the image which should be transparent needs to have ... and actually paint the underlying image over the top image. ... > is a blue filled circle with a magenta background. ...
    (comp.lang.java.programmer)