Results 1 to 7 of 7
  1. #1
    itaipee is offline Member
    Join Date
    Dec 2008
    Posts
    99
    Rep Power
    0

    Default change the delay between double click in mouse listener

    Hello

    I have mouse listener - work fine beside one thing -
    I need to increase the delay between two clicks. the user for my programs dont like to click fast..

    How can I increase the premited delay ? ( here my code

    Java Code:
    public void mouseClicked(MouseEvent e) {
    
    			if (e.getClickCount() == 2) {
    				JList l1 = (JList) e.getComponent();
    				int ind = l1.locationToIndex(e.getPoint());
    									System.out.println(listModel.get(ind));
    				
    
    			}
    
    		}
    }

  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    Interpretation of a double click vs. two single clicks is done by the OS. Your users need to adjust the double click rate using the utility your OS provides. In Windows, go to the mouse control panel.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Working on with this using Java application seems mess to me. What's the point doing this in this way, can you explain a bit?

  4. #4
    itaipee is offline Member
    Join Date
    Dec 2008
    Posts
    99
    Rep Power
    0

    Default

    Working on with this using Java application seems mess to me. What's the point doing this in this way, can you
    explain a bit?

    I'm kind of stuck with it. I started this project and learn java in the same time .

    Any way - that what I have. You have any idea how to increase the delay between two clicks ?

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    As toadaly explain in his last post, this is related with the OS. So what's the point here. User wants to change OS settings through a Java application. Accessing the OS utilities on Java is not an easy task, as far as I know. You have to deal with Windows OS using Java.

  6. #6
    itaipee is offline Member
    Join Date
    Dec 2008
    Posts
    99
    Rep Power
    0

    Default

    I'm using unix

  7. #7
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    The KDE has a similar mouse control panel. Although it is *possible* to change the double click rate for your program, it's a bad idea. Your program will then behave differently than everything else.

    If this is your only customer and you don't mind writing throwaway code you won't be able to use anywhere else, and they demand it, then AbstractButton.setMultiClickThreshold() should work for you. Again though, this is not advised.

Similar Threads

  1. How to detect double click with a JFrame
    By Jary316 in forum New To Java
    Replies: 3
    Last Post: 01-05-2009, 08:39 PM
  2. mouse click do not work after repaint
    By nobody in forum Java 2D
    Replies: 8
    Last Post: 12-07-2008, 04:43 PM
  3. mouse click alert
    By amir in forum AWT / Swing
    Replies: 1
    Last Post: 08-05-2008, 10:42 PM
  4. Problem in mouse click n repaint
    By Preethi in forum New To Java
    Replies: 4
    Last Post: 07-04-2008, 11:16 AM
  5. Mouse Right click option not working in solaris and linux OS
    By dinesh kaushik in forum AWT / Swing
    Replies: 2
    Last Post: 11-21-2007, 04:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •