Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » repaint embedded AWT frame
repaint embedded AWT frame [message #456718] Tue, 07 June 2005 14:41 Go to next message
Eclipse UserFriend
Originally posted by: simonm.iptech.no.spam.demon.co.uk

I embed an AWT frame in an SWT composite with

Composite composite = new Composite(mainComposite, SWT.EMBEDDED |
SWT.BORDER);
Frame frame = SWT_AWT.new_Frame(composite);

Later I add a JPanel to the frame with

JPanel panel = getDymanicallyGeneratedPanel();
frame.add(panel);

and at this stage I want to force a repaint so that I see the new
JPanel. I was hoping that some combination of composite.redraw(),
frame.repaint(), or frame.invalidate() would do this, but the only way
I've found is to resize the composite, which isn't very satisfactory.
Can anyone suggest a way to force a repaint more directly?

Thanks,

Simon Morris
Re: repaint embedded AWT frame [message #457121 is a reply to message #456718] Fri, 17 June 2005 11:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: not.important.com

Simon Morris wrote:

> and at this stage I want to force a repaint so that I see the new
> JPanel. I was hoping that some combination of composite.redraw(),
> frame.repaint(), or frame.invalidate() would do this, but the only way
> I've found is to resize the composite, which isn't very satisfactory.
> Can anyone suggest a way to force a repaint more directly?

I had the same Problem. Try the following:
composite.setVisible(false);
[your code for update the content]
composite.setVisible(true);

This works fine for me.

Greetings,
Volker Pilz
Re: repaint embedded AWT frame [message #457123 is a reply to message #457121] Fri, 17 June 2005 13:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: simonm.iptech.no.spam.demon.co.uk

On Fri, 17 Jun 2005 11:39:03 +0000 (UTC), not@important.com (Volker
Pilz) wrote:

>Simon Morris wrote:
>
>> and at this stage I want to force a repaint so that I see the new
>> JPanel. I was hoping that some combination of composite.redraw(),
>> frame.repaint(), or frame.invalidate() would do this, but the only way
>> I've found is to resize the composite, which isn't very satisfactory.
>> Can anyone suggest a way to force a repaint more directly?
>
>I had the same Problem. Try the following:
>composite.setVisible(false);
>[your code for update the content]
>composite.setVisible(true);
>
>This works fine for me.
>

That solves my problem - thanks very much.

Simon Morris
Re: repaint embedded AWT frame [message #457829 is a reply to message #457123] Tue, 05 July 2005 15:37 Go to previous message
Eclipse UserFriend
Originally posted by: simonm.iptech.no.spam.demon.co.uk

On Fri, 17 Jun 2005 14:27:49 +0100, Simon Morris
<simonm@iptech.no.spam.demon.co.uk> wrote:

>On Fri, 17 Jun 2005 11:39:03 +0000 (UTC), not@important.com (Volker
>Pilz) wrote:
>
>>Simon Morris wrote:
>>
>>> and at this stage I want to force a repaint so that I see the new
>>> JPanel. I was hoping that some combination of composite.redraw(),
>>> frame.repaint(), or frame.invalidate() would do this, but the only way
>>> I've found is to resize the composite, which isn't very satisfactory.
>>> Can anyone suggest a way to force a repaint more directly?
>>
>>I had the same Problem. Try the following:
>>composite.setVisible(false);
>>[your code for update the content]
>>composite.setVisible(true);
>>
>>This works fine for me.
>>
>
>That solves my problem - thanks very much.
>

In fact the call to setVisible(true) worked on its own, and avoided
the flicker produced by setVisible(false) then setVisible(true).

S.
Previous Topic:How to copy an area of Composite as an image to system clipboard?
Next Topic:MDI behaviour, Shell floating in other Shell
Goto Forum:
  


Current Time: Thu Apr 25 10:59:49 GMT 2024

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

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

Back to the top