Yes I have seen the flickering you are experiencing.The solution however is quite simple, before putting the JMap in the SWT bridge put it in a JPanel and your flicker will go away. Check out the following code sample which should get you displaying a flicker free map:
import org.eclipse.swt.widgets.Text;
import com.esri.client.toolkit.overlays.DrawingOverlay;
import com.esri.client.toolkit.overlays.DrawingOverlay.DrawingMode;
import com.esri.core.symbol.SimpleFillSymbol;
import com.esri.core.symbol.SimpleLineSymbol;
import com.esri.map.ArcGISTiledMapServiceLayer;
import com.esri.map.JMap;
import com.esri.runtime.ArcGISRuntime;
import com.esri.runtime.ArcGISRuntime.RenderEngine;
public class SWTJMapTest {
public static void main(String[] args) throws InvocationTargetException, InterruptedException {
ArcGISRuntime.setRenderEngine(RenderEngine.OpenGL);
final Display display = new Display();
Shell shell = new Shell(display);
Composite comp = new Composite(shell, SWT.EMBEDDED | SWT.NO_BACKGROUND);
comp.setBounds(5, 5, 500, 500);
final java.awt.Frame frame = SWT_AWT.new_Frame(comp);
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
JMap map = new JMap();
ArcGISTiledMapServiceLayer tiledLayer = new ArcGISTiledMapServiceLayer(
"http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer");
map.getLayers().add(tiledLayer);
DrawingOverlay drawing = new DrawingOverlay();
drawing.setUp(DrawingMode.POLYLINE_RECTANGLE, new SimpleLineSymbol(Color.red, 2.0f), null);
map.addMapOverlay(drawing);
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(map, BorderLayout.CENTER);
frame.add(panel); // no flicker
//frame.add(map); // flickers
}
});
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
Let me know if this helpsMark