1

in my application the mouse cursor does not change when over text field or other components (eg table resize).

The class MainWindow implements ActionListener and ListSelectionListener, could there be a cause? I never used MouseMotionListener or others.

Any ideas what could be the cause? Thanks

Edit:

Found cause: A panel containing the components was set disabled, the components worked fine, but the cursor didn't change when moving hover as the panel seems to be in charge of triggering that. maybe this post helps other lost souls

4
  • 2
    please give us the code you have in implements Commented Jan 10, 2014 at 9:34
  • 1
    Do you want to change default Cursor to custom when you under some component? Commented Jan 10, 2014 at 10:05
  • Components don't resize automatically, so the cursor will not change to support the resize cursors. Commented Jan 10, 2014 at 16:32
  • No custom cursors. I'm missing the default cursors that appears when you enter a component like a text field, or border of columnes of a table (sry, not the component itself). The cursors that tell the user, what he can do. Commented Jan 10, 2014 at 17:32

1 Answer 1

1

You can try the following code (replace label_3 by your text field) :

Cursor cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR); 
label_3.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent e) {
frame.setCursor(cursor);
                }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.