Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » GC Can Not DrawFocus On Window 7 64Bit
GC Can Not DrawFocus On Window 7 64Bit [message #694891] Sun, 10 July 2011 05:57 Go to next message
sunchaoqun  is currently offline sunchaoqun Friend
Messages: 1
Registered: July 2011
Junior Member
Is there anybody knows why the GC can not drawFocus on Window 7(Is it a bug),it works fine on WindowXP,my source code below:

package org.scq.test;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class DrawFocusRectangle {
  public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setText("Canvas Example");
    shell.setLayout(new FillLayout());

    Canvas canvas = new Canvas(shell, SWT.NONE);

    canvas.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent e) {
        e.gc.drawFocus(5, 5, 200,10);
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
Re: GC Can Not DrawFocus On Window 7 64Bit [message #695711 is a reply to message #694891] Tue, 12 July 2011 11:39 Go to previous message
Lakshmi ShanmugamFriend
Messages: 276
Registered: July 2009
Location: India
Senior Member

I don't have Windows 7 so I'm unable to test your snippet. Please open a bug report with SWT here so that it can be investigated --> &component=SWT


Lakshmi P Shanmugam
Previous Topic:Paint Event triggered by Verify Event
Next Topic:Certain objects refuse to appear in pop-up
Goto Forum:

Current Time: Fri Dec 04 00:08:20 GMT 2020

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

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

Back to the top