How to capture the event of CTRL+[Click of mouse]?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Chester_Woo
Posted On:   Monday, September 23, 2002 08:04 PM

It seems that a bug of sun jdk1.3. In filchooser, error will occur when CTRL button and mouse left key are both pressed down at one time. So I do the following things to shield this action: ... JList list = new JList(defaultListModel); Handler handler = new Handler(); list.addKeyListener(handler); list.addMouseListener(handler); private class Handler implements KeyListener, MouseListener { ... } ... But the solution is not concise one. Would you give me some constructive suggestions to help me find a better way? I'd appreciate that.    More>>

It seems that a bug of sun jdk1.3.
In filchooser, error will occur when CTRL button and mouse left key are both pressed down at one time.

So I do the following things to shield this action:


...

JList list = new JList(defaultListModel);

Handler handler = new Handler();

list.addKeyListener(handler);

list.addMouseListener(handler);


private class Handler implements KeyListener, MouseListener
{
...

}

...



But the solution is not concise one. Would you give me some constructive suggestions to help me find a better way?
I'd appreciate that.

   <<Less

Re: How to capture the event of CTRL+[Click of mouse]?

Posted By:   Kesavan_Srinivasan  
Posted On:   Monday, September 23, 2002 09:32 PM

Hi Chester,


In the MouseEvent class therez a method called isControlDown(), u can use this method to find whether the CTRL is down!

Hope this solves ur problem. If u hv further queries write me at kesavansrini@yahoo.co.in

Kesavan.

About | Sitemap | Contact