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.