Chman
Junior Devvie  
Nothing more that... Java games are cool !
|
 |
«
Posted
2003-03-16 16:24:13 » |
|
I wonder if there was a way to create an irrgular window in Java... by "irregular" I mean that it can be, for example, a triangle window, or a circular window, or even a window with transparent hole in it!
Does anyone knows how to do that in Java ? or is there any lib (native or not) available on the web to do that ?
Thanks Chman
|
|
|
|
JasonB
|
 |
«
Reply #1 - Posted
2003-03-16 16:46:19 » |
|
I recall l2fprod having a native (windows) DLL for doing irregular windows. haven't checked recently, but it might still be available ( www.l2fprod.com)
|
|
|
|
cfmdobbie
Senior Devvie    Medals: 1
Who, me?
|
 |
«
Reply #2 - Posted
2003-03-17 07:34:18 » |
|
Not something I've tried, but I believe it should work:
If you use a "Window" not a "Frame" you do away with all the titlebars, window frame etc. Then you can use a pixel-grabber to snapshot the screen contents behind your window, and paint them over the top to make your window effectively transparent. Then you're free to draw whatever shape windows you want!
PROS: Works pretty much everywhere without need for external libraries.
CONS: A lot more work, and you have to draw all the window decorations you want manually.
|
Hellomynameis Charlie Dobbie.
|
|
|
Games published by our own members! Check 'em out!
|
|
Chman
Junior Devvie  
Nothing more that... Java games are cool !
|
 |
«
Reply #3 - Posted
2003-03-17 12:07:55 » |
|
Thx for your replies... I think cfmdobbie's solution is a good one (no need for external libs) but is not the easier to do... and not the faster !
|
|
|
|
Herkules
|
 |
«
Reply #4 - Posted
2003-03-17 12:16:38 » |
|
cfmdobbie's solution does not cover event handling! I don't know how to ignore mouseclicks to the non-opaque parts of the window or to delegate them to the desktop/parent.
|
|
|
|
Chman
Junior Devvie  
Nothing more that... Java games are cool !
|
 |
«
Reply #5 - Posted
2003-03-17 12:25:07 » |
|
ah yeah it's true, i haven't thought about that... o l2fprod would be a great solution but it's windows specific so...
|
|
|
|
cfmdobbie
Senior Devvie    Medals: 1
Who, me?
|
 |
«
Reply #6 - Posted
2003-03-17 13:02:21 » |
|
Good point - I hadn't considered event handling.  Hrm, with the requirement to properly handle window events as well, I'm afraid you're high and dry. There's no way I know to do that in a platform-independant way. You will probably have to drop back to JNI, get a handle to the window and manipulate it directly with native windowing commands. Ouch.
|
Hellomynameis Charlie Dobbie.
|
|
|
Chman
Junior Devvie  
Nothing more that... Java games are cool !
|
 |
«
Reply #7 - Posted
2003-03-17 14:27:13 » |
|
Ouch !  I will finally keep my classical Java JFrame...
|
|
|
|
pepe
Junior Devvie  
Nothing unreal exists
|
 |
«
Reply #8 - Posted
2003-03-18 02:49:46 » |
|
there was a thread on the old board about that. there was even some code using Robot's screencapture. The thread ended with "it's a 1.5 feature", as far as i recall.. 
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Chman
Junior Devvie  
Nothing more that... Java games are cool !
|
 |
«
Reply #10 - Posted
2003-03-19 16:09:12 » |
|
Ca fait plaisir de voir des francais sur cette board ! non en fait ca n'a aucun rapport avec la team cHMan... tu faisait référence à Banja, un jeu en flash de la team en question... mon pseudo vient de nul part... et j'ai l'habitude de l'écrire Ch*man pour éviter la confusion avec cHMan...
|
|
|
|
mill
Junior Devvie  
popcorn freak
|
 |
«
Reply #11 - Posted
2003-03-20 18:09:48 » |
|
argh! why do people post in languages other than english? english the the most common language here as this is a forum and the whole purpose is to let people communicate. i'm sure everyone would understand me typing swedish!
bad english is also ok! (i know you french people don't like it very much)
|
|
|
|
cfmdobbie
Senior Devvie    Medals: 1
Who, me?
|
 |
«
Reply #12 - Posted
2003-03-20 20:15:16 » |
|
|
Hellomynameis Charlie Dobbie.
|
|
|
mill
Junior Devvie  
popcorn freak
|
 |
«
Reply #13 - Posted
2003-03-20 20:38:33 » |
|
it's not so bad on this forum, not yet anyway. at cgtalk for instance it's a common thing and it's pretty pointless. anyway, i have no idea what chocolate moose you're talking about lol  sorry for drifting away from topic..
|
|
|
|
pepe
Junior Devvie  
Nothing unreal exists
|
 |
«
Reply #14 - Posted
2003-03-21 02:04:37 » |
|
Hem, sorry, guys. The little french sentence was to ask about the origin of ch*man's nick. There are times you feel quite alone as a French citizen, actually more than ever.  Some 'native' words help sometimes. Well... Enough drama, will not do that again, i swear. (moreover, i wasn't sure to explain myself correctly in english.. that was a lazy solution as well. ) Back on topic. After re reading the bug report i posted here, and the answer from sun, i'm not sure that the RFE is to be implemented. Isn't there an AWT team member reading us?
|
|
|
|
mill
Junior Devvie  
popcorn freak
|
 |
«
Reply #15 - Posted
2003-03-21 05:45:42 » |
|
you're not alone, we are all with you! 
|
|
|
|
javatypo
|
 |
«
Reply #16 - Posted
2003-04-06 19:24:51 » |
|
having a transparent window could post some pretty weird things..
like u could make your program launch an entire window, that is totally transparent, and have no way out..
hehe.. that'd be pretty funny..
why do u want a transparent window anyway??
|
|
|
|
cfmdobbie
Senior Devvie    Medals: 1
Who, me?
|
 |
«
Reply #17 - Posted
2003-04-06 21:42:06 » |
|
It's less having transparent windows than shaped windows. Rounded corners to your windows, a round (analogue) clock, see-through areas etc.
|
Hellomynameis Charlie Dobbie.
|
|
|
javatypo
|
 |
«
Reply #18 - Posted
2003-04-07 18:06:50 » |
|
thatd be annoying to have se thru parts of a window..
wouldnt it?
|
|
|
|
cfmdobbie
Senior Devvie    Medals: 1
Who, me?
|
 |
«
Reply #19 - Posted
2003-04-07 19:27:20 » |
|
Um. Not if that's what you wanted to have? 
|
Hellomynameis Charlie Dobbie.
|
|
|
swpalmer
|
 |
«
Reply #20 - Posted
2003-04-07 23:59:30 » |
|
Rounded corners, or completely wacky UI shapes like the skinned views of latest MS Media players.. That's the sort of stuff that we need.
It would also be a way to drag arbitrary objects over the desktop.. instead of just getting some lame cursor that doesn't really show what is happening.
I think it is time to add support for windows with an alpha channel (even if it is restricted to 1-bit on some platforms) to Java. All popular windowing systems support this feature now, so it makes sense.
|
|
|
|
Abuse
|
 |
«
Reply #21 - Posted
2003-04-08 00:09:16 » |
|
sounds like fun, though I dread to think how a semi transparent full screen frame would behave 
|
|
|
|
|