Results 1 to 3 of 3
  1. #1
    PrinceSendai is offline Member
    Join Date
    Jul 2010
    Location
    Lima, Peru
    Posts
    47
    Rep Power
    0

    Default JPopupMenu Consecutive Clicks

    Hello.

    1. I have two JTree's, side by side.

    2. Both JTrees have a JPopupMenu associated with them.

    3. I right click on a node in the JTree1, the jpopupmenu appears.

    4. I left click on a node in JTree2.


    In theory, if I left click on a node in JTree2, it should select the node.


    5. The jpopupmenu disappears, but no node is selected. In fact, the click event is never fired in JTree2.




    In other words, THE CLICK EVENT IS NOT FIRING WHILE THE POPUPMENU IS ACTIVATED. The click merely deactivates the popup menu, but the click event on the tree is never fired.


    Please help me if you know why this is, and how to solve this. Is this a bug?



    Thanks so much.

  2. #2
    PrinceSendai is offline Member
    Join Date
    Jul 2010
    Location
    Lima, Peru
    Posts
    47
    Rep Power
    0

    Default Re: JPopupMenu Consecutive Clicks

    I have found the solution.


    UIManager.put("PopupMenu.consumeEventOnClose", Boolean.FALSE);

  3. #3
    PrinceSendai is offline Member
    Join Date
    Jul 2010
    Location
    Lima, Peru
    Posts
    47
    Rep Power
    0

    Default Re: JPopupMenu Consecutive Clicks

    Yes, this was a bug.

    I found the bug explanation here, if anyone is interested. Apparently mousePressed() is not fired when the JPopupMenu is visible.


    Bug ID: 6753637 Windows LNF prevents mousePressed() from being called when JPopupMenuvisible

    regards

Similar Threads

  1. four consecutive characters
    By aortell24 in forum New To Java
    Replies: 3
    Last Post: 06-19-2012, 02:32 AM
  2. Consecutive null valors identifier - Suggestions
    By Bonfy in forum New To Java
    Replies: 4
    Last Post: 01-23-2012, 05:50 PM
  3. Differentiating user clicks and doClick clicks?
    By jiffi in forum New To Java
    Replies: 19
    Last Post: 01-13-2012, 08:30 AM
  4. Replies: 23
    Last Post: 07-04-2011, 02:26 AM
  5. Responding to clicks outside a window
    By bayan in forum New To Java
    Replies: 6
    Last Post: 06-14-2010, 04:51 PM

Tags for this Thread

Posting Permissions

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