onclick - How to draw selectable lines using java swt -
i wondering if guide me in right direction. writing code using java swt, have 2 composites , connector connecting 2 composites. want able detect mouse click event on both composites , connector. mouse click on composite achieved not sure how achieve mouse click on connector. drawing connector using gc. following code draws line
gc gc = new gc(composite); gc.fillrectangle(composite.getclientarea()); gc.setforeground(composite.getdisplay().getsystemcolor(swt.color_black)); gc.setlinewidth(3); gc.drawline(x,y,x,y);
the above code draws line between 2 composite (taking starting point , ending point). now, want able detect when user clicks on line connecting 2 composites. there better way connect 2 composite give me ability detect mouse click.
i appreciate if guide me towards right direction.
thanks, rohith
Comments
Post a Comment