I have 2 Jpanel (leftpanel and rightpanel) on JFrame. How can I change the cursor when the mouse’s over the intersection area of 2 panels?
So far, i tried :
...
public void mouseMoved(MouseEvent e) {
if (leftpanel.contains(e.getPoint()) && rightpanel.contains(e.getPoint())){
frame.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
}
else{ frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
};
but it was not working..
Your question was how to detect the intersection of two panels and change the cursor. Here is an example of how to do that