Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Transparent Windows  (Read 2148 times)
0 Members and 1 Guest are viewing this topic.
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Posted 2012-09-14 23:15:29 »

I have seen some posts in the past that have asked if Java can do transparent windows with the answers indicating that it can't be done. It looks like the ability has been added recently.

http://www.javacodegeeks.com/2012/09/make-jframe-transparent.html

I have tried it on Windows 7 and it works.

Offline ReBirth
« Reply #1 - Posted 2012-09-15 03:45:51 »

Oracle may thinks it should adapt on current theme like aero glass, so they putted it.

Offline Best Username Ever

Junior Member





« Reply #2 - Posted 2012-09-15 06:07:39 »

That's probably not the case. Window opacity normally applies to windows as a whole, so it's not like you can change the alpha of individual pixels.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline BoBear2681

JGO Coder


Medals: 18



« Reply #3 - Posted 2012-09-15 07:03:54 »

That's probably not the case. Window opacity normally applies to windows as a whole, so it's not like you can change the alpha of individual pixels.

Actually, the API does support per-pixel translucency.  Note also that if you're using Java 7, there's an "official" API now, and you shouldn't use the AWTUtilities class.
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #4 - Posted 2012-09-15 09:45:09 »

Ha, Oracle's own JWS doesn't work, awesome.

Offline theagentd
« Reply #5 - Posted 2012-09-15 14:32:55 »

I have an old project where I wanted to make your desktop into a physics sandbox. I wrote a 20 line C program which read the size of all open windows and streamed that to my Java program, which in turn created a JBox2D body of each window. Maximized windows and any window behind them were ignored. I then drew these using Java2D to a fully transparent fullscreen JFrame. It worked, but the performance of a 1920x1080 transparent JFrame was laughable, and I also had some problems when windows were moved around (kaboooooom said the physics), so I dropped it. It did "work" though.

Myomyomyo.
Offline Best Username Ever

Junior Member





« Reply #6 - Posted 2012-09-15 17:55:00 »

Interesting. I wonder if changing the shape sends mouse events to the (native) window behind it or if it gets trapped in a rectangle surrounding it.
Offline counterp

Senior Member


Medals: 11



« Reply #7 - Posted 2012-09-15 18:13:20 »

I did this a while back http://www.java-gaming.org/topics/transparent-jframe-background/24635/msg/208284/view.html

Though granted, in my window I don't use the built in java components, but my own custom ones (using listeners, graphics and such)

(PS I also used an undecorated window so I added my own dragging, and it's not totally smooth but good enough)
Offline theagentd
« Reply #8 - Posted 2012-09-16 02:02:50 »

Interesting. I wonder if changing the shape sends mouse events to the (native) window behind it or if it gets trapped in a rectangle surrounding it.
Clicks go through the window when the color is fully transparent, if that's what you mean.

Myomyomyo.
Offline BoBear2681

JGO Coder


Medals: 18



« Reply #9 - Posted 2012-09-16 04:31:33 »

One problem IIRC is that you cannot get anti-aliased edges with window shapes, so it's tough to get anything really fancy looking good as far as "shaping" a window, short of slightly rounded corners.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline theagentd
« Reply #10 - Posted 2012-09-16 15:24:05 »

One problem IIRC is that you cannot get anti-aliased edges with window shapes, so it's tough to get anything really fancy looking good as far as "shaping" a window, short of slightly rounded corners.
I had antialiasing on my physics desktop. Even transparency works...

Myomyomyo.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (20 views)
2014-07-29 18:09:19

Riven (13 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (31 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (28 views)
2014-07-23 21:07:15

Riven (29 views)
2014-07-23 20:56:16

ctomni231 (60 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!