Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT/AWT flickering problem
SWT/AWT flickering problem [message #464023] Wed, 16 November 2005 14:47 Go to next message
Eclipse UserFriend
Originally posted by: nlupanov.outsourcingbg.com

I am integrating existing Swing gui into Eclipse plugin - therefore i use
the
SWT_AWT.new_Frame() method to gain java.awt.Frame class and add swing
component to it.
This is the code of the eclipse plugin view:


public class ETL4ALLWorkerView extends ViewPart {

public static final String ID = "EclipsePluginETL4ALL.WorkerView";
Frame frame;
Composite swt_frame;
Canvas canvas;
public ETL4ALLWorkerView() {
super();
}

public void createPartControl(Composite parent) {

swt_frame = new Composite(parent, SWT.EMBEDDED | SWT.NO_REDRAW_RESIZE);
frame = SWT_AWT.new_Frame(swt_frame);
TransformClient clientFrame = null;
if((clientFrame = Perspective.getETL4ALLMainFrame()) == null){
clientFrame = TransformClient.plugin_main();
Perspective.setETL4ALLMainFrame(clientFrame);
}

//The following is a JDesktopPane that i use to add JInternalFrames to:
WorkerPanel workerPane = clientFrame.getWorkerPane();
frame.setBackground(new Color(180,70,220));
frame.add(workerPane);


public void setFocus() {

}

}

I am trying to add the swing JDesktopPane to java.awt.Frame .The
JDesktopPane includes
JInternalFrame.The problem is that the GUI is flickering when resized or
moved.
I migrated from jre1.4 to jre1.5 and the flickering of the JDesktopPane
stops but the
JInternalFrame is still flickering when resized/moved.I am wondering if at
this point this is
a SWT/Swing integration issue or AWT/Swing issue.
Re: SWT/AWT flickering problem [message #464025 is a reply to message #464023] Wed, 16 November 2005 15:10 Go to previous messageGo to next message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
Following the example of this snippet may help:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet154.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup

If you setup a root pane and possibly set the sun.awt.noerasebackground
property, flicker will be reduced (but, in my experience, not completely
eliminated).

N.Lupanov wrote:
> I am integrating existing Swing gui into Eclipse plugin - therefore i use
> the
> SWT_AWT.new_Frame() method to gain java.awt.Frame class and add swing
> component to it.
> This is the code of the eclipse plugin view:
>
>
> public class ETL4ALLWorkerView extends ViewPart {
>
> public static final String ID = "EclipsePluginETL4ALL.WorkerView";
> Frame frame;
> Composite swt_frame;
> Canvas canvas;
> public ETL4ALLWorkerView() {
> super();
> }
>
> public void createPartControl(Composite parent) {
>
> swt_frame = new Composite(parent, SWT.EMBEDDED | SWT.NO_REDRAW_RESIZE);
> frame = SWT_AWT.new_Frame(swt_frame);
> TransformClient clientFrame = null;
> if((clientFrame = Perspective.getETL4ALLMainFrame()) == null){
> clientFrame = TransformClient.plugin_main();
> Perspective.setETL4ALLMainFrame(clientFrame);
> }
>
> //The following is a JDesktopPane that i use to add JInternalFrames to:
> WorkerPanel workerPane = clientFrame.getWorkerPane();
> frame.setBackground(new Color(180,70,220));
> frame.add(workerPane);
>
>
> public void setFocus() {
>
> }
>
> }
>
> I am trying to add the swing JDesktopPane to java.awt.Frame .The
> JDesktopPane includes
> JInternalFrame.The problem is that the GUI is flickering when resized or
> moved.
> I migrated from jre1.4 to jre1.5 and the flickering of the JDesktopPane
> stops but the
> JInternalFrame is still flickering when resized/moved.I am wondering if at
> this point this is
> a SWT/Swing integration issue or AWT/Swing issue.
>
>
Re: SWT/AWT flickering problem [message #464083 is a reply to message #464025] Wed, 16 November 2005 18:53 Go to previous messageGo to next message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
there is any work in mustang for this problem
http://weblogs.java.net/blog/zixle/archive/2005/04/no_more_g ray_re_1.html
Gordon Hirsch wrote:

> Following the example of this snippet may help:
>
>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet154.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup
>
> If you setup a root pane and possibly set the sun.awt.noerasebackground
> property, flicker will be reduced (but, in my experience, not completely
> eliminated).
>
> N.Lupanov wrote:
>> I am integrating existing Swing gui into Eclipse plugin - therefore i use
>> the
>> SWT_AWT.new_Frame() method to gain java.awt.Frame class and add swing
>> component to it.
>> This is the code of the eclipse plugin view:
>>
>>
>> public class ETL4ALLWorkerView extends ViewPart {
>>
>> public static final String ID = "EclipsePluginETL4ALL.WorkerView";
>> Frame frame;
>> Composite swt_frame;
>> Canvas canvas;
>> public ETL4ALLWorkerView() {
>> super();
>> }
>>
>> public void createPartControl(Composite parent) {
>>
>> swt_frame = new Composite(parent, SWT.EMBEDDED |
>> SWT.NO_REDRAW_RESIZE); frame = SWT_AWT.new_Frame(swt_frame);
>> TransformClient clientFrame = null;
>> if((clientFrame = Perspective.getETL4ALLMainFrame()) == null){
>> clientFrame = TransformClient.plugin_main();
>> Perspective.setETL4ALLMainFrame(clientFrame);
>> }
>>
>> //The following is a JDesktopPane that i use to add JInternalFrames to:
>> WorkerPanel workerPane = clientFrame.getWorkerPane();
>> frame.setBackground(new Color(180,70,220));
>> frame.add(workerPane);
>>
>>
>> public void setFocus() {
>>
>> }
>>
>> }
>>
>> I am trying to add the swing JDesktopPane to java.awt.Frame .The
>> JDesktopPane includes
>> JInternalFrame.The problem is that the GUI is flickering when resized or
>> moved.
>> I migrated from jre1.4 to jre1.5 and the flickering of the JDesktopPane
>> stops but the
>> JInternalFrame is still flickering when resized/moved.I am wondering if
>> at this point this is
>> a SWT/Swing integration issue or AWT/Swing issue.
>>
>>
Re: SWT/AWT flickering problem [message #464093 is a reply to message #464083] Wed, 16 November 2005 18:56 Go to previous messageGo to next message
Gordon Hirsch is currently offline Gordon HirschFriend
Messages: 100
Registered: July 2009
Senior Member
Have you actually seen improvements with the early Mustang releases?

I noticed this bug fix too, and hoped it would help... but I didn't
really see a difference when I tried running with recent Mustang builds.

Haris Peco wrote:
> there is any work in mustang for this problem
> http://weblogs.java.net/blog/zixle/archive/2005/04/no_more_g ray_re_1.html
> Gordon Hirsch wrote:
>
>> Following the example of this snippet may help:
>>
>>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet154.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup
>> If you setup a root pane and possibly set the sun.awt.noerasebackground
>> property, flicker will be reduced (but, in my experience, not completely
>> eliminated).
>>
>> N.Lupanov wrote:
>>> I am integrating existing Swing gui into Eclipse plugin - therefore i use
>>> the
>>> SWT_AWT.new_Frame() method to gain java.awt.Frame class and add swing
>>> component to it.
>>> This is the code of the eclipse plugin view:
>>>
>>>
>>> public class ETL4ALLWorkerView extends ViewPart {
>>>
>>> public static final String ID = "EclipsePluginETL4ALL.WorkerView";
>>> Frame frame;
>>> Composite swt_frame;
>>> Canvas canvas;
>>> public ETL4ALLWorkerView() {
>>> super();
>>> }
>>>
>>> public void createPartControl(Composite parent) {
>>>
>>> swt_frame = new Composite(parent, SWT.EMBEDDED |
>>> SWT.NO_REDRAW_RESIZE); frame = SWT_AWT.new_Frame(swt_frame);
>>> TransformClient clientFrame = null;
>>> if((clientFrame = Perspective.getETL4ALLMainFrame()) == null){
>>> clientFrame = TransformClient.plugin_main();
>>> Perspective.setETL4ALLMainFrame(clientFrame);
>>> }
>>>
>>> //The following is a JDesktopPane that i use to add JInternalFrames to:
>>> WorkerPanel workerPane = clientFrame.getWorkerPane();
>>> frame.setBackground(new Color(180,70,220));
>>> frame.add(workerPane);
>>>
>>>
>>> public void setFocus() {
>>>
>>> }
>>>
>>> }
>>>
>>> I am trying to add the swing JDesktopPane to java.awt.Frame .The
>>> JDesktopPane includes
>>> JInternalFrame.The problem is that the GUI is flickering when resized or
>>> moved.
>>> I migrated from jre1.4 to jre1.5 and the flickering of the JDesktopPane
>>> stops but the
>>> JInternalFrame is still flickering when resized/moved.I am wondering if
>>> at this point this is
>>> a SWT/Swing integration issue or AWT/Swing issue.
>>>
>>>
>
Re: SWT/AWT flickering problem [message #464097 is a reply to message #464093] Wed, 16 November 2005 20:14 Go to previous messageGo to next message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
i just try with build 60 and didn't see a difference, too
Gordon Hirsch wrote:

> Have you actually seen improvements with the early Mustang releases?
>
> I noticed this bug fix too, and hoped it would help... but I didn't
> really see a difference when I tried running with recent Mustang builds.
>
> Haris Peco wrote:
>> there is any work in mustang for this problem
>> http://weblogs.java.net/blog/zixle/archive/2005/04/no_more_g ray_re_1.html
>> Gordon Hirsch wrote:
>>
>>> Following the example of this snippet may help:
>>>
>>>
>>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet154.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup
>>> If you setup a root pane and possibly set the sun.awt.noerasebackground
>>> property, flicker will be reduced (but, in my experience, not completely
>>> eliminated).
>>>
>>> N.Lupanov wrote:
>>>> I am integrating existing Swing gui into Eclipse plugin - therefore i
>>>> use the
>>>> SWT_AWT.new_Frame() method to gain java.awt.Frame class and add swing
>>>> component to it.
>>>> This is the code of the eclipse plugin view:
>>>>
>>>>
>>>> public class ETL4ALLWorkerView extends ViewPart {
>>>>
>>>> public static final String ID = "EclipsePluginETL4ALL.WorkerView";
>>>> Frame frame;
>>>> Composite swt_frame;
>>>> Canvas canvas;
>>>> public ETL4ALLWorkerView() {
>>>> super();
>>>> }
>>>>
>>>> public void createPartControl(Composite parent) {
>>>>
>>>> swt_frame = new Composite(parent, SWT.EMBEDDED |
>>>> SWT.NO_REDRAW_RESIZE); frame = SWT_AWT.new_Frame(swt_frame);
>>>> TransformClient clientFrame = null;
>>>> if((clientFrame = Perspective.getETL4ALLMainFrame()) == null){
>>>> clientFrame = TransformClient.plugin_main();
>>>> Perspective.setETL4ALLMainFrame(clientFrame);
>>>> }
>>>>
>>>> //The following is a JDesktopPane that i use to add JInternalFrames to:
>>>> WorkerPanel workerPane = clientFrame.getWorkerPane();
>>>> frame.setBackground(new Color(180,70,220));
>>>> frame.add(workerPane);
>>>>
>>>>
>>>> public void setFocus() {
>>>>
>>>> }
>>>>
>>>> }
>>>>
>>>> I am trying to add the swing JDesktopPane to java.awt.Frame .The
>>>> JDesktopPane includes
>>>> JInternalFrame.The problem is that the GUI is flickering when resized
>>>> or moved.
>>>> I migrated from jre1.4 to jre1.5 and the flickering of the JDesktopPane
>>>> stops but the
>>>> JInternalFrame is still flickering when resized/moved.I am wondering if
>>>> at this point this is
>>>> a SWT/Swing integration issue or AWT/Swing issue.
>>>>
>>>>
>>
Re: SWT/AWT flickering problem [message #464186 is a reply to message #464025] Fri, 18 November 2005 12:12 Go to previous message
Eclipse UserFriend
Originally posted by: nlupanov.outsourcingbg.com

I am aware with this example it it still does not help.I am trying to embedd
a swing JDesktopPane into java.awt.Frame that is integrated with the SWT
Composite object of the plugin view.Another think i have noticed is that it
flickers with the java.awt.Frame's background so maybe it is an AWT/Swing
issue.



"Gordon Hirsch" <eclipse@gordonh.com> wrote in message
news:dlfi52$63h$1@news.eclipse.org...
> Following the example of this snippet may help:
>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet154.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup
>
> If you setup a root pane and possibly set the sun.awt.noerasebackground
> property, flicker will be reduced (but, in my experience, not completely
> eliminated).
>
> N.Lupanov wrote:
>> I am integrating existing Swing gui into Eclipse plugin - therefore i use
>> the
>> SWT_AWT.new_Frame() method to gain java.awt.Frame class and add swing
>> component to it.
>> This is the code of the eclipse plugin view:
>>
>>
>> public class ETL4ALLWorkerView extends ViewPart {
>>
>> public static final String ID = "EclipsePluginETL4ALL.WorkerView";
>> Frame frame;
>> Composite swt_frame;
>> Canvas canvas;
>> public ETL4ALLWorkerView() {
>> super();
>> }
>>
>> public void createPartControl(Composite parent) {
>>
>> swt_frame = new Composite(parent, SWT.EMBEDDED |
>> SWT.NO_REDRAW_RESIZE);
>> frame = SWT_AWT.new_Frame(swt_frame);
>> TransformClient clientFrame = null;
>> if((clientFrame = Perspective.getETL4ALLMainFrame()) == null){
>> clientFrame = TransformClient.plugin_main();
>> Perspective.setETL4ALLMainFrame(clientFrame);
>> }
>>
>> //The following is a JDesktopPane that i use to add JInternalFrames to:
>> WorkerPanel workerPane = clientFrame.getWorkerPane();
>> frame.setBackground(new Color(180,70,220));
>> frame.add(workerPane);
>>
>>
>> public void setFocus() {
>>
>> }
>>
>> }
>>
>> I am trying to add the swing JDesktopPane to java.awt.Frame .The
>> JDesktopPane includes
>> JInternalFrame.The problem is that the GUI is flickering when resized or
>> moved.
>> I migrated from jre1.4 to jre1.5 and the flickering of the JDesktopPane
>> stops but the
>> JInternalFrame is still flickering when resized/moved.I am wondering if
>> at this point this is
>> a SWT/Swing integration issue or AWT/Swing issue.
>>
Previous Topic:Problem with background in Table
Next Topic:Browser.setText + links
Goto Forum:
  


Current Time: Fri Apr 26 02:59:31 GMT 2024

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

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

Back to the top