Capturing double click of right and left mouse buttons

Hi everybody,
I am writing a application which makes use of mouse. My difficulty is like how to capture the right and left double click of mouse?
Please guide its urgent.Any reply will really appreciate
Thank you
dgk

hi
hope the piece of code helps u out
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
public class MouseClicks extends JFrame implements MouseListener
static public void main(String[] args)
          MouseClicks targetFrame = new MouseClicks("Drop");
targetFrame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) { System.exit(0);}
targetFrame.setSize (800, 500);
targetFrame.setVisible(true);
public MouseClicks(String str) {
          super(str);
          addMouseListener(this);
public void mouseClicked(MouseEvent e)
          if(SwingUtilities.isLeftMouseButton(e))
               if(e.getClickCount() == 2)
               System.out.println("LeftDoubleClicked");
               else
               System.out.println("LeftSingleClicked");
          else if(SwingUtilities.isRightMouseButton(e))
               if(e.getClickCount() == 2)
               System.out.println("RightDoubleclicked");
               else
               System.out.println("RightSingleClick");
public void mousePressed(MouseEvent e)
public void mouseReleased(MouseEvent e)
public void mouseEntered(MouseEvent e)
public void mouseExited(MouseEvent e)
cheers

Similar Messages

  • Hp envy can't right and left click at same time

    my hp envy touchpad cant hp envy can't right and left click at same time. i dont know if its a driver. because of that i cant play games like GTA cause i need right click to aim and left click to shoot. is there a solution to this 
    This question was solved.
    View Solution.

    @gwatanaj ,
    Hello and thank you for posting on the HP support forums.  Here is a link that you may find useful.
    HP Notebook PCs - Using and Troubleshooting the TouchPad or ClickPad (Windows 8)
    What you are trying to do may not work with your touchpad.  Normally when gaming it is best to use a mouse.  The hardware is built different and you would find it easier to work with.
    If you need further help please post back.  First check out this link.
    Advice for asking the "Very Best Question"
    As well please include your Full Model and Product Number.
    I hope to hear back from you soon.
    Thank you again and have a great day.
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    D5GR
    I work on behalf of HP

  • My apple wireless mouse scrolls in the opposite direction. When I scroll up, down, right and left it always scrolls the opposite direction. Can anyone help?

    My apple wireless mouse scrolls in the opposite direction. When I scroll up, down, right and left it always scrolls the opposite direction. Can anyone help?

    Hi Malky H.,
    Thanks for visiting Apple Support Communities.
    If your mouse is not scrolling in the direction you are expecting, check this Mouse setting in System Preferences:
    Choose Apple menu > System Preferences, then click Mouse.
    Scroll direction: natural: Select this option to move the contents of a window in the same direction as your fingers.
    You can find this information here:
    OS X Yosemite: Use an Apple Magic Mouse
    Note that these steps apply to previous versions of Mac OS X as well.
    Best Regards,
    Jeremy

  • At the top of my homepage, I'm getting a message "Downloading the latest applications", but the circle to the left keeps spinning, and no applications are downloaded. I don't know how to stop this, tried right and left clicking on the bar. This occurs

    At the top of my homepage, I'm getting a message "Downloading the latest applications", but the circle to the left keeps spinning, and no applications are downloaded. I don't know how to stop this, tried right and left clicking on the bar. This occurs every time I open Firefox. How can I stop or disable this?
    == This happened ==
    Every time Firefox opened
    == Several weeks ago.

    See http://kb.mozillazine.org/Software_Update (Software Update not working properly)
    Remove the files in the ''updates'' and ''updates\0'' folder:
    Vista/Windows7:
    C:\Users\<user>\AppData\Local\Mozilla\Firefox\Mozilla Firefox\ (updates)
    C:\Users\<user>\AppData\Local\VirtualStore\Program Files\Mozilla Firefox\ (updates)
    %LOCALAPPDATA%\Mozilla\Firefox\Mozilla Firefox\updates\

  • How to remove black "blocked plug-in" window that opens with iPhoto. It covers iPhoto and everything under it. I've right and left clicked the black window, restarting the computer, shutting down the computer, but the window always appears when I ope

    How to remove black "blocked plug-in" window that opens with iPhoto. It covers iPhoto and everything under it. I've right and left clicked the black window, restarting the computer, shutting down the computer, but the window always appears when I open iPhoto and it will not move or go away. It stays on my screen (covering my desktop icons) even after I quit iPhoto. How can I get it off my screen?

    Which version if iPhoto and MacOS X do you have?
    Do you have any iPhoto plug-ins  installed?
    Open the folder /Library/Application Support/iPhoto/Plugins/
    To navigate to that folder, open the folder "Library" directly on your Macintosh HD, then inside the Library folder go to Application Support, then iPhoto.  Is there anything installed?

  • Why do i have to keep clicking my left mouse button to make the program work it just stops and if left click it starts working

    Why do i have to keep clicking my left mouse button to make the program work it just stops and if left click it starts working. I'v only just started to use this program and It's no good at all if I go to a website and click a button I have to keep clicking it to finish what its doing.

    hello jeffsprig, can you try to replicate this behaviour when you launch firefox in safe mode once?
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    multiple other affected users have reported that this was an issue caused by malware on their pc. please run a scan of your system with [http://www.bleepingcomputer.com/download/adwcleaner/ adwcleaner] and the [http://www.malwarebytes.org/products/malwarebytes_free free version of malwarebytes].
    [[Troubleshoot Firefox issues caused by malware]]

  • Problem highlighting and moving things with left mouse button on Sat A100

    Hi,
    my problem started after a reinstall, I wanted to highlight something on a web page, then copy and paste it, but couldn't.
    Then I wanted to move the bar on a excel worksheet, but couldn't, the cursor changes shape etc nut it wont let me highlight or move stuff?
    (i've downloaded the most recent drivers etc)
    It's a bit like the right and left click actions are a bit mixed up?
    Any ideas?
    Thanks
    Grant

    Mouse button configuration can be set for right-handed and left-handed users.
    Have you checked this option in mouse properties?

  • How do I take the zoom feature off my MacBook Pro? I have already went to System Preferences and turned "zoom" off in the Universal Access. I saw where someone said to use THREE fingers to double click... ??? Double click what? And 3 fingers?

    Can someone help me?How do I take the zoom feature off my MacBook Pro? I have already went to System Preferences and turned "zoom" off in the Universal Access. I saw where someone said to use THREE fingers to double click... ??? Double click what? And 3 fingers?

    What really cheeses me off here is that Apple isn't allowing users enough customization.  With each update of iTunes (and the OS and iOS) we're forced to give up something that worked well for the way we want to use the app and make do with fewer (and lamer) options.  If Apple keeps this up, they're going to start losing customers fast.  I mean if this isn't fixed soon, I'm pretty sure I'm going to give up on iTunes, and then I'll probably go ahead and get a Galaxy when I need to replace my iPhone.
    What I don't understand about how they won't let users delete the list of available podcasts now is why?  How is this making it a better program?  I can understand that not all users are capable enough to right-click on a feed and select "Show all available episodes", so I can see why they want the complete list to be the default (and, surprise, it already was).  But to not give users the option to delete that list?  It's inconsiderate because it makes navigating feeds with a large back catalogue really frustrating.  I'm flabbergasted that no one at Apple considered all the podcast feeds that keep hundreds of episodes available when they removed this feature.  It smacks of rank incompetence.
    What improvement were they trying to make here anyway?  There was nothing wrong to my mind about how podcasts were managed in previous versions.  Whatever improvement they were trying to make here, they should have realized that many users would at least want the option to keep things the way they were.
    And reverting to a previous version is no solution.  I can't sync my iPhone with the new iOS without this update, and (while I do have some issues--specifically how you can't play podcasts in the Music app anymore) I do like the new iOS.

  • Cross-Tab should expand right and left sides equally

    Hi,
    We are using Crystal Report XI release 2, Cross-Tab expands towards right side.
    Our report parameter range is not constant.
    When fewer columns we can get based on parameter, Cross-Tab does not look good because it prints left to right and we can see a lot space at right side of the page.
    User asking put it in center, but it does not look good when we get more columns (it prints left to right).
    We can achieve a good look, if it grows left and right sides equally.
    How to achieve this please give me some suggestions.
    Thanks and Regards,
    Manjunath N, J Jogin

    Though you can not make a CrossTab grow equally on right and left side but you can reduce the Gap at the end .
    To achieve this,please Right  Click on the cross --> Cross Tab Expert --> Customized Style tab and uncheck the checkbox Keep Columns Together
    Also for the summary fields, make them left aligned by default CR aligns numeric fields to the right. do the same thing for Row/column headers. This way you'll save lot of space.
    Hope this helps!

  • How do I share / unlink  the right and left channel, so I can work with them individually ?

    I use "Adobe Sound Booster CS5"
    I have a stereo soundtrack, which I only want to remove noise in only one channel (right).
    How do I share / unlink the right and left channel, so I can work with them individually ?

    When Soundbooth was first developed, it had a few extra things than what were not available in Audition. However, Audition remained the more high end sound editing tool. Soundbooth was locked to a multiple channel editing approach. In Audition, single editing is easy - you simply click the L or R at the right end of the sound channel to lock it and then you can edit the other channel only.
    Soundbooth has been discontinued and Audition now has taken its place from CS6 to the Creative Cloud.
    The above is some background info. To your current situation, you can use a workaround like:
    * Export your audio file to separate channels by File > Export > Channels to mono files.
    You will get 2 files with _L and _R suffix.
    You can then edit them separately. You can go from Mono to Stereo by the following step.
    Or
    * Choose - Edit > Insert > Channels  into New Multitrack file.
    That will separate the Left and Right Channels and add them to a new multitrack file.
    You can then click the Edit link at the top right of the channel to edit it.
    You can then save that file as a new audio file.
    Dean

  • Right mouse button and middle mouse button

    Hi,
    How can i add a right mouse button and middle mouse button
    click in captivate, is there a way out of this.

    Hi prem1280
    There is a Developer Center article that may help here.
    Click
    here to read it.
    Additionally, if you are planning on publishing to .EXE
    format, fellow Adobe Community Expert Paul Dewhurst has something
    at
    This
    Link that you may be interested in.
    Cheers... Rick

  • Elements 8 [Mac IOS 10.9]:  4 X 6" borderless printing -- top and bottom 1" are cutoff in Portrait and right and left 1 " are cutoff in Landscape

    I am using Elements 8 [with a recently installed Mac IOS 10.9] and a new Epson Artisan 1430 printer .  When I print 4" X 6" borderless photos, the top and bottom 1" are now cutoff in Portrait orientation and the right and left 1" are cutoff in Landscape orientation.  I do not have the same problem printing from iPhoto.  Epson tech support says this is not an Epson problem.  Does anyone have any suggestions?  Maybe I should just install Elements 12 and see if this might solve the problem.  Any ideas?   

    When you have the problem, note the exact time: hour, minute, second.   
    These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    Each message in the log begins with the date and time when it was entered. Scroll back to the time you noted above. Select the messages entered from then until the end of the episode, or until they start to repeat, whichever comes first. Copy the messages to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of it useless for solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • I'm trying to mix a guitar track so it is heard in the right and left ear and not in the center

    I'm trying to mix a guitar track in GarageBand.  I'd like to have the same guitar track heard in the right and left ear.  When I mix it that way, the guitar comes from the center.  Is there a way to place this track so that it appears to come from both the left and right side?

    Mr. Snook wrote:
    If my finger picked guitar track is doubled and pasted slightly ahead or behind, the guitars will be out of sync, I think, and sound off in mix.
    emphasis on "tiny amount"
    TINY fractions of a second. this is how you get the "full sound"
    zoom in as far as you can, and make sure the "snap to grid" and "alignment guides" menuItems are not checked.

  • Camera Vision Loop Snap will be 1% right and left inverse in Vision2013 and Labview 2013.

    Hello,
    I use a Camera to Loop Capture Vision Snap in Vision2013 and Labview 2013.
    (see the right-up picture that is the needle in the right side, but the right-down picture it is in the left side.)
    The right-up picture that is the current snap image shows normally.
    The right-down picture is after en-queued and de-queued image.
    But the image will be 1 % Randenly Chance to show right and left inverse.
    Could someone tell me how to solve the problem?
    Thanks.
    Attachments:
    IMAQ_Mirro_)_(.JPG ‏149 KB
    IMAQ_realtime_image_snap_queue.JPG ‏196 KB

    Good-day.
    2 Cameras are both the same "AVT GUPPY F033B"  , Connected to the IEEE1394 interface PCI Card (2 ports, Controller Chip is Texas Instruments).(See" cam_driver.JPG")
    Both Cameras are 1 % Randenly right and left inverse.(See" IMAG_Mirro_)_(2.JPG")
    The Labview 2012 program is the attached file called "IMAGE_LOOP_SNAP_Queue As a Multiplexer_LV2012.vi.zip"
    Thanks.
    Attachments:
    cam_driver.JPG ‏55 KB
    IMAQ_Mirro_)_(_2.JPG ‏159 KB
    IMAGE_LOOP_SNAP_Queue As a Multiplexer_LV2012.vi.zip ‏769 KB

  • Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems n

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

Maybe you are looking for

  • 10.9 server ical server

    In 10.6 server to create a shared calendar, ie a calenndar that everyone can see and add to, i had to create a calendar user called ical server, which all the real users became a delegate of, people wanting to share the calendar on their iphones or i

  • Aperture 2 and iPhoto '08

    I was considering getting iLife '08, primarily only for iPhoto '08. But I procrastinated because I didn't really want to spend 80 bucks for just iPhoto. Now that I am going to get Aperture 2, would it benefit me to upgrade to iLife '08? Thanks.

  • Will The Genius Bar Install Snow Leopard in 2014?

    I have an intel-based MacBook Pro from 2009 (I think) that is running 10.5 and I'd like to upgrade to Mavericks. If I make a genius bar appointment, will the tech there install Snow Leopard for me (I'd pay for Snow Leopard) as opposed to me ordering

  • Restore image link preview when right-clicking?

    In the new version of Firefox on Ubuntu 10.04 whenever I right-click on images I no longer am able to see a preview of the image URL. In older versions I was able to, but in order to see the URL I need to either copy the image location and open in a

  • End Call + Answer

    When you are on a call and another call comes in the choices it gives are "Ignore" call & "Hold Call + Answer." Most of the time I just want to end the call I am on & answer the new call. Why does it give such screwy options?