|
Re: Problem with setOpaque() [message #196866 is a reply to message #196820] |
Tue, 27 September 2005 15:42 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Shapes are special figures, and you need to use setFill(false) if you want
them to be transparent.
"Jens" <jens.bartelheimer@gmx.de> wrote in message
news:dhbeor$ccg$1@news.eclipse.org...
> Hi,
>
> I have a problem with the method setOpaque(). I need a transparent
> figure but this method does nothing?!?
>
> Here my code:
>
> The second rectangle overlaps the first one. The second rectangle should
> be transparent so that I could see the first one. But this doesn't work.
> What is wrong?
>
>
> public class A {
> public static void main(String args[]) {
> Shell shell = new Shell();
> shell.setSize(200, 300);
> shell.open();
> shell.setText("Chart");
> LightweightSystem lws = new LightweightSystem(shell);
> Figure f=new Figure();
> f.setLayoutManager(new XYLayout());
> lws.setContents(f);
>
> RectangleFigure a = new RectangleFigure();
> a.setSize(10,10);
> a.setLocation(new Point(10,10));
> f.add(a);
>
> RectangleFigure b = new RectangleFigure();
> b.setSize(10,10);
> b.setLocation(new Point(15,15));
> b.setOpaque(false);
> f.add(b);
>
> Display display = Display.getDefault();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> }
> }
>
> Jens.
|
|
|
Powered by
FUDForum. Page generated in 0.03521 seconds