4 messages in net.java.dev.jna.usersRe: [jna-users] Transparent Window
FromSent OnAttachments
Jain, Anant (GE Healthcare)Feb 3, 2009 3:08 am 
Timothy WallFeb 3, 2009 3:51 am 
Jain, Anant (GE Healthcare)Feb 3, 2009 4:06 am 
Timothy WallFeb 3, 2009 5:52 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Transparent WindowActions...
From:Timothy Wall (twal@dev.java.net)
Date:Feb 3, 2009 5:52:05 am
List:net.java.dev.jna.users

On Feb 3, 2009, at 7:07 AM, Jain, Anant (GE Healthcare) wrote:

Yes I need a window because we show another clickable component under the window.

I don't understand why having a clickable component in your JFrame necessitates using a window for the overlay.

I am not sure I understood what you meant by map the bounds of the window to match that of the Jframe.

For example, this is what I currently use:

------------------- protected void clipFrame() { Polygon vignetteMask = new Polygon();

vignetteMask.addPoint(0, 0); vignetteMask.addPoint(0, 1024); vignetteMask.addPoint(256, 1024); vignetteMask.addPoint(256, 326); vignetteMask.addPoint(129, 326); vignetteMask.addPoint(129, 126); vignetteMask.addPoint(256, 126); vignetteMask.addPoint(256, 0); WindowUtils.setWindowMask(_parentFrame, vignetteMask); }

------------------

If I need to change the WindowMask to the position (50, 200, 128, 300) (x, y, width, heigh) while the frame itself is 256x1024 (WxH), how would I achieve this?

My issue is, if I create a polygon mask with those co-ordinates, it will show only the window and clip out the rest of the frame. I need to do the reverse :)

You need to invert the shape. Start with a rectangle the size of your frame, then subtract your polygon.