|
|
How to make a JFrame Transparent
i am trying to make my JFrame window Transparent.How it is possible??
|
|
0
|
|
|
|
Reply
|
moumitaghosh (6)
|
12/27/2005 2:49:36 PM |
|
moumitaghosh@tataelxsi.co.in wrote:
> i am trying to make my JFrame window Transparent.How it is possible??
Java root components are opaque (not invisible).
You can emulate transparaney (poorly) by doing a screencapture.
<http://groups.google.com/group/comp.lang.java.gui/browse_frm/thread/b00948f2062e9338/efb8c4c90c30bd16?hl=en#efb8c4c90c30bd16>
...and also there is this..
<http://groups.google.com/group/comp.lang.java.advocacy/browse_frm/thread/378ce69e8ad8d315/4dfdec202e1bef74?hl=en#4dfdec202e1bef74>
(view the screenshot)
HTH
--
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
|
|
0
|
|
|
|
Reply
|
Andrew
|
12/27/2005 10:43:55 PM
|
|
Thanks for ur solution.Actually my problem is i'm trying to create an
assistant(just like MS office)which i can place and move on my JFrame
application.
At first i placed another JFrame on my application,which shows the
assistant.But the problem was,it was not transparent.So whenever i
moved it over any button,the button disappears.
Now,according to your solution if i want to create another class (like
TransparentWindow).I'm unable to move it over my application.....plz hlp
|
|
0
|
|
|
|
Reply
|
moumitaghosh
|
12/28/2005 7:11:31 AM
|
|
moumitaghosh@tataelxsi.co.in 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
|
|
0
|
|
|
|
Reply
|
Andrew
|
12/28/2005 11:07:00 AM
|
|
Thank u very much.
i have got the solution.
|
|
0
|
|
|
|
Reply
|
moumitaghosh
|
12/28/2005 12:48:57 PM
|
|
|
4 Replies
235 Views
(page loaded in 3.686 seconds)
|
|
|
|
|
|
|
|
|