有一个图片放到窗体中. 图片上有4个(桌), 点每个桌实现不同的功能. 之前我是这样做的. 
protected void createContents() {
shell = new Shell();
shell.setLayout(new GridLayout());
shell.setSize(500, 375);
shell.setText("SWT Application"); final Label label = new Label(shell, SWT.NONE);
final GridData gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
gridData.heightHint = 237;
gridData.widthHint = 483;
label.setLayoutData(gridData);
label.setBackgroundImage(SWTResourceManager.getImage(Test.class, "flow.jpg"));
label.addMouseListener(new MouseAdapter() {
public void mouseDoubleClick(final MouseEvent e) {
openMBox(e);
}
});
//
}
//分别获取每个桌的4个角点,判断
public void openMBox(MouseEvent e){
MessageBox mb = new MessageBox(shell);
int stock_x1 = 200;
int stock_y1 = 10;
int stock_x2 = 260;
int stock_y2 = 60;

int inventory_x1 = 60;
int inventory_y1 = 80;
int inventory_x2 = 115;
int inventory_y2 = 150;

int sale_x1 = 350;
int sale_y1 = 80;
int sale_x2 = 415;
int sale_y2 = 150;

int rpt_x1 = 200;
int rpt_y1 = 175;
int rpt_x2 = 265;
int rpt_y2 = 215;

if(e.x >= stock_x1 && e.x <= stock_x2 && e.y >= stock_y1 && e.y <= stock_y2){
mb.setMessage("1");
} else if(e.x >= inventory_x1 && e.x <= inventory_x2 && e.y >= inventory_y1 && e.y <= inventory_y2){
mb.setMessage("2");
} else if(e.x >= sale_x1 && e.x <= sale_x2 && e.y >= sale_y1 && e.y <= sale_y2){
mb.setMessage("3");
} else if(e.x >= rpt_x1 && e.x <= rpt_x2 && e.y >= rpt_y1 && e.y <= rpt_y2){
mb.setMessage("4");
} else {
mb.setMessage("X : " + e.x + " Y : " + e.y);
}
mb.open();
}但是老大的要求是让我用canvas上监听MOUSE CLICK事件
原话:
[即在一canvas上监听MOUSE CLICK事件
当CLICK时取得事件的X,Y位置
若这个X,Y位置在原先指定的几个X,Y组合值内,则SHOW一个窗体 ]
我就改成用绘图的方式, 但是后面类似map的功能依然没变,
大家有什么建议和妙招没, 想说什么就说.. 谢谢大家了. 
Display display = new Display();
final Shell shell = new Shell(display, SWT.SHELL_TRIM | SWT.NO_BACKGROUND);
final Image image = new Image(display, "F:\\CCRJ\\CCRJ_DEVENV2\\ccrjlcwork\\emisCCRJV15\\image\\flow.jpg");
final Rectangle rect = image.getBounds();


shell.addListener(SWT.Paint, new Listener() {
public void handleEvent(Event e) {
GC gc = e.gc;
gc.drawImage(image, 0, 0);

Rectangle client = shell.getClientArea();
int marginWidth = client.width - rect.width;
if (marginWidth > 0) {
gc.fillRectangle(rect.width, 0, marginWidth, client.height);
}
int marginHeight = client.height - rect.height;
if (marginHeight > 0) {
gc.fillRectangle(0, rect.height, client.width, marginHeight);
}
gc.dispose();
}
});ps:近期项目要求用SWT, 所以临时学的. 有什么不对的地方请大家指出. 谢谢了.