Bug 298089

Summary: Cursor not set beyond a boundary in swing
Product: [Eclipse Project] Platform Reporter: radu <rhadoo003>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: andi_dm1
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description radu CLA 2009-12-17 10:53:06 EST
Run the following snippet and make sure that the shell has the x location greater than zero. Move the mouse to right part of the shell and you will observe that the mouse changes from hand to arrow.




import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import javax.swing.*;
import java.awt.*;

public class SwingMouseCursor {

 public static void main(String[] args) {
  Display display = new Display();
  Shell shell = new Shell(display);
  shell.setLayout(new FillLayout());

  Composite composite = new Composite(shell, SWT.EMBEDDED);
  final Frame frame = SWT_AWT.new_Frame(composite);
  frame.setLayout(new BorderLayout());
  final JPanel jPanel = new JPanel();
  frame.add(jPanel, BorderLayout.CENTER);
  jPanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

  shell.open();
  while (!shell.isDisposed()) {
   if (!display.readAndDispatch()) {
    display.sleep();
   }
  }
  display.dispose();
 }
}
Comment 1 Eclipse Webmaster CLA 2019-09-06 15:36:11 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.