

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
4 messages in net.java.dev.jna.usersRE: [jna-users] Transparent Window| From | Sent On | Attachments |
|---|---|---|
| Jain, Anant (GE Healthcare) | Feb 3, 2009 3:08 am | |
| Timothy Wall | Feb 3, 2009 3:51 am | |
| Jain, Anant (GE Healthcare) | Feb 3, 2009 4:06 am | |
| Timothy Wall | Feb 3, 2009 5:52 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | RE: [jna-users] Transparent Window | Actions... |
|---|---|---|
| From: | Jain, Anant (GE Healthcare) (anan...@ge.com) | |
| Date: | Feb 3, 2009 4:06:58 am | |
| List: | net.java.dev.jna.users | |
Yes I need a window because we show another clickable component under the window.
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 :)
Thanks AJ
-----Original Message----- From: Timothy Wall [mailto:twal...@dev.java.net] Sent: Tuesday, February 03, 2009 5:22 PM To: use...@jna.dev.java.net Subject: Re: [jna-users] Transparent Window
If the overlay doesn't need to extend beyond the window, you don't need a window; you can use a transparent JPanel. There are numerous examples of implementing overlays in Swing (see http://rabbit-hole.blogspot.com/2006/04/decoratingoverpainting-swing.htm l , http://rabbit-hole.blogspot.com/2006/11/waiting-and-blocking-input.html , or the JXLayer project on java.net).
If you really need a window, just map the bounds of the window to match that of the JFrame.
On Feb 3, 2009, at 6:09 AM, Jain, Anant (GE Healthcare) wrote:
Hi,
I have a requirement to create a transparent window in the middle of a Jframe. Earlier, we had the window on one of the edges of the frame so the polygon could be specified the appropriate co-ordinates to go around the window.
But now I need to create with no contact with the edge. So how would I specify the coordinates of the window in this case?
Thanks AJ







