Composite comp = new Composite(parent, SWT.NONE); comp.addMouseListener(new MouseListener() { @Override public void mouseDoubleClick(MouseEvent e) { // handle double click event } @Override public void mouseDown(MouseEvent e) { // handle mouse down event } @Override public void mouseUp(MouseEvent e) { // handle mouse up event } });
Composite comp = new Composite(parent, SWT.NONE); comp.addKeyListener(new KeyListener() { @Override public void keyPressed(KeyEvent e) { // handle key pressed event } @Override public void keyReleased(KeyEvent e) { // handle key released event } });Package Library: The org.eclipse.swt.widgets package is part of the Eclipse SWT (Standard Widget Toolkit) library, which provides a set of common UI components for building desktop applications using Java.