Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » setOpaque() problem
setOpaque() problem [message #461487] Mon, 26 September 2005 15:10 Go to next message
Jens Bartelheimer is currently offline Jens BartelheimerFriend
Messages: 44
Registered: July 2009
Member
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.
Re: setOpaque() problem [message #461489 is a reply to message #461487] Mon, 26 September 2005 15:22 Go to previous message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Jens" <jens.bartelheimer@gmx.de> wrote in message
news:dh931h$6u5$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?
>
[snip]

This question belongs in the GEF newsgroup.
---
Sunil
Previous Topic:Programatically open Combo list?
Next Topic:Weird problems resizing Shell with 'setBounds()'
Goto Forum:
  


Current Time: Thu Oct 19 11:07:28 GMT 2017

Powered by FUDForum. Page generated in 0.01994 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software