Stop Java Events

When a mouse event occur in one JComboBox or other Swing Component, i want to kill the event before do something.

To be more precise, when the JCombo is clicked, droplist is not to be showed.

Thanks
GuillyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
NevynConnect With a Mentor Commented:
Why use a combo box if you don't want it to drop the list?
However, you may be able to use the consume method of some event classes. However, if the combo box uses event listeners to handle the drop list, it would be processed before ny listeners you can register. Ma need to sub-class JComboBox and intervene in the processEvent method.
0
 
adam923Commented:
//i haven't tried this but it just might work :-)

public class NoMouseJComponent extends JComponent{
   protected void processMouseMotionEvent(MouseEvent e){}
}
0
 
Jim CakalicSenior Developer/ArchitectCommented:
By 'kill the event' do you mean you want to intervene in the event dispatching and prevent other listeners from being notified? Somehow abort the handling of the event?
0
 
GuillyAuthor Commented:
Edited text of question.
0
All Courses

From novice to tech pro — start learning today.