R
RC
Since JComboBox and JButton both are
extends from JComponent.
When I addMouseListener(this);
for jButton, it listens to the MouseEvent.
But jComboBox doesn't listen to the MouseEvent.
public void mouseEntered(MouseEvent me) {
System.out.println("mouse entered");
jComboBox.setToolTipText("mouse entered"); // not work
jButton.setToolTipText("mouse entered button"); // works fine
}
mouseEntered just move your mouse pointer on
the object, no need to click (pressed and released).
I just want to detect the mouse entered on JComboBox
(i.e. popup a ToolTip) before I click it for select an item.
Do I miss something? Do I need to setXXX and/or enableXXX
JComboBox before I addMouseListener?
Thank Q for your help!
extends from JComponent.
When I addMouseListener(this);
for jButton, it listens to the MouseEvent.
But jComboBox doesn't listen to the MouseEvent.
public void mouseEntered(MouseEvent me) {
System.out.println("mouse entered");
jComboBox.setToolTipText("mouse entered"); // not work
jButton.setToolTipText("mouse entered button"); // works fine
}
mouseEntered just move your mouse pointer on
the object, no need to click (pressed and released).
I just want to detect the mouse entered on JComboBox
(i.e. popup a ToolTip) before I click it for select an item.
Do I miss something? Do I need to setXXX and/or enableXXX
JComboBox before I addMouseListener?
Thank Q for your help!