Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Flickering panels in SWT_AWT bridge solved!
Flickering panels in SWT_AWT bridge solved! [message #650991] Thu, 27 January 2011 12:08 Go to next message
Marcel Austenfeld is currently offline Marcel AustenfeldFriend
Messages: 160
Registered: July 2009
Senior Member
Hello,

i recently wrote about a problem which occured after the introduction of the Java plattform >1.6.07.
See bug:
Bug 91157 - embedded SWT_AWT frames flicker when the SWT window is resized :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=91157

Swing panels embedded with the swt_awt bridge were flickering for example if a resize event occurs. With Java <=1.6.07 no flickering occured. Today i changed the snippet:

http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt.sn ippets/src/org/eclipse/swt/snippets/Snippet154.java?view=co

after i read this article again:
http://www.eclipse.org/articles/article.php?file=Article-Swi ng-SWT-Integration/index.html

I integrated a JApplet as a root container and the flickering dissapeared (tested only under Windows!).

.......
try {
System.setProperty("sun.awt.noerasebackground", "true");
} catch (NoSuchMethodError error) {
}

/* Create and setting up frame */
Frame frame = SWT_AWT.new_Frame(composite);
JApplet panel = new JApplet() {
public void update(java.awt.Graphics g) {
/* Do not erase the background */
paint(g);
}

};
frame.add(panel);
JRootPane root = new JRootPane();
panel.add(root);
java.awt.Container contentPane = root.getContentPane();
...........



I hope this information will be a help for people using the swt_awt bridge.

Apropos:

Let me know if this works also under Linux or MacOSX
Re: Flickering panels in SWT_AWT bridge solved! [message #651016 is a reply to message #650991] Thu, 27 January 2011 13:06 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 2011-01-27 13:08, Marcel wrote:
> i recently wrote about a problem which occured after the introduction of
> the Java plattform >1.6.07.
> See bug:
> Bug 91157 - embedded SWT_AWT frames flicker when the SWT window is
> resized :
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=91157
>
> Swing panels embedded with the swt_awt bridge were flickering for
> example if a resize event occurs. With Java <=1.6.07 no flickering
> occured. Today i changed the snippet:
>
> http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt.sn ippets/src/org/eclipse/swt/snippets/Snippet154.java?view=co
>
>
> after i read this article again:
> http://www.eclipse.org/articles/article.php?file=Article-Swi ng-SWT-Integration/index.html
>
>
> I integrated a JApplet as a root container and the flickering
> dissapeared (tested only under Windows!).

Let me add to this the following information: Personally, I strongly
recommend to use as a higher-level bridge the albireo library

http://wiki.eclipse.org/Albireo_Project

instead of using the SWT_AWT bridge directly: We use this library
successfully since more than a year and I won't return: It contains much
more fixes than above single issue.

Greetings from Bremen,

Daniel Krügler
Re: Flickering panels in SWT_AWT bridge solved! [message #651024 is a reply to message #651016] Thu, 27 January 2011 13:40 Go to previous messageGo to next message
Marcel Austenfeld is currently offline Marcel AustenfeldFriend
Messages: 160
Registered: July 2009
Senior Member
Hello Daniel,

indeed i use parts of the Albireo project but this project seems to be abondened so i'm interested in the official supported way to use the swt_awt API.
However i did not know that they actually did integrate a solution for the flickering. Have you tested it with the latest Java versions and under different OS environments?

My intention to post this information:
It is hard to find information about the right use of the bridge and the snippets on the internet have to be corrected for the latest java versions. Since 2004 i'm struggeling with the swt_awt bridge under Window and Linux. Hopefully more fixes will be available in the future.

Greetings from Kiel

Marcel
Re: Flickering panels in SWT_AWT bridge solved! [message #652970 is a reply to message #650991] Mon, 07 February 2011 19:15 Go to previous messageGo to next message
Marcel Austenfeld is currently offline Marcel AustenfeldFriend
Messages: 160
Registered: July 2009
Senior Member
Some additional information:

On Linux (Ubuntu) everything works fine, too.

On MacOSX the problem is still existent.

Furthermore on MacOSX annoying lock errors occur:

...[NSConditionLock unlock]: lock (<NSConditionLock: 0x143cc0> '(null)') unlocked when not locked
.....

[Updated on: Mon, 07 February 2011 19:15]

Report message to a moderator

Re: Flickering panels in SWT_AWT bridge solved! [message #1122536 is a reply to message #652970] Tue, 01 October 2013 17:25 Go to previous message
Marcel Austenfeld is currently offline Marcel AustenfeldFriend
Messages: 160
Registered: July 2009
Senior Member
The problem seems to be fixed using Java 1.7.40. The first time in my RCP history i have no flickering panels under Mac, Linux and Windows with the swt_awt bridge.

[Updated on: Tue, 01 October 2013 18:50]

Report message to a moderator

Previous Topic:SWT "/dev/null" driver?
Next Topic:Diagonal Gradient
Goto Forum:
  


Current Time: Thu Apr 25 10:34:35 GMT 2024

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

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

Back to the top