![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
Transparent GUI?
Does anyone know if its possible to change the opacity of a GUI in Swing, or make it transparent?
__________________
Hoes telling me to calm down but I'm like fuck that shit!
|
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
Bump-Izzle!?
since i cant edit previous post, i meant to say on a JFrame can i make it somewhat invisible.
__________________
Hoes telling me to calm down but I'm like fuck that shit!
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: Nov 2004
Posts: 84
Rep Power: 4
![]() |
I'm a little fuzzy on this at the moment (it is the day after New Years, after all
) Anyway, IIRC, you will have to use JNI because it is the Windows OS that controls how the windows are drawn, so it is Windows that must be manipulated.
__________________
HijackThis Team-SFDC |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Jan 2006
Location: Dallas, TX
Posts: 49
Rep Power: 0
![]() |
There is a non native way to do it, however, I'm not sure how fast or smooth it is. I have tried things similar to this to make transparent backgrounds and they seem to work fairly well, but when I dragged them around to fast I saw a little distortion while they were repainting. Try it out and see what you think.
http://www.onjava.com/pub/a/onjava/e...inghks_hack41/ |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Nov 2004
Posts: 84
Rep Power: 4
![]() |
I saw that method also, but to me that isn't really making the window transparent, but I suppose if it serves the purpose, then why not use it.
![]()
__________________
HijackThis Team-SFDC |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
|
thanx, alcdotcom, it works perfectly, for 100+ lines of code!?, god why couldnt sun just implement a transparency feature in java themselves...jerks...
__________________
Hoes telling me to calm down but I'm like fuck that shit!
|
|
|
|
|
|
#7 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
I assume because Sun's goal is to make Java completely platform independant (not all OSes support transparency), and because the Swing is a pretty old toolkit, designed when transparency support was not commonplace. Sun also tend to take their sweet time with updates
![]() |
|
|
|
|
|
#8 | |
|
Programmer
Join Date: Nov 2004
Posts: 84
Rep Power: 4
![]() |
Quote:
![]()
__________________
HijackThis Team-SFDC |
|
|
|
|
|
|
#9 |
|
Programmer
Join Date: Jan 2006
Location: Dallas, TX
Posts: 49
Rep Power: 0
![]() |
Being platform independant has its advantages, but when you want a specific platform behaviour (beyond L&F) it can be annoying. They have added some new features to Mustang (JDK 1.6) that will fill some of the gaps. Maybe they'll even uptade the HTMLEditor kit support modern web standards so I can stop using 3rd party code to render HTML.
![]() |
|
|
|
|
|
#10 |
|
Hobbyist Programmer
|
ok is there anyway i can interface with windows or something along those lines, screw cross platform i just want a friggin transparent gui.(not transparent, but change the opacity to less than 100%), i know you can do it in C#, so is there a windows api i should look for?
__________________
Hoes telling me to calm down but I'm like fuck that shit!
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|