Bug 298089 - Cursor not set beyond a boundary in swing
Summary: Cursor not set beyond a boundary in swing
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-17 10:53 EST by radu CLA
Modified: 2019-09-06 15:36 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.