0

It seems after showing a JPopupmenu using the show() method it requires 2 clicks to select a JButton or any component with a ActionListener attached to it; one click for the popup menu to disappear and another to be actually detected by the components with ActionListener.

Is there anyway to make it so it clicking on a button the first time is detected?

Sammy Guergachi
  • 1,986
  • 4
  • 26
  • 52
  • 3
    For better help sooner, post an [MCVE](http://stackoverflow.com/help/mcve) (Minimal Complete and Verifiable Example). – Andrew Thompson May 27 '14 at 04:46
  • It works fine for me. What `show()` method do you reffer to. Component's show() is deprecated. – DSquare May 27 '14 at 12:45
  • @DSquare talking about the show(component, x, y) method in JPopupmenu. When I click on a JButton the popup disappears but the button is not selected. – Sammy Guergachi May 27 '14 at 17:06
  • With a comboBox and the showPopup() method it works fine. See Andrew Thompson comment, try making a very small program with the kind of popup you are using and a button where this happens. You might find an error elsewhere doing this. – DSquare May 27 '14 at 17:11
  • Alright, i'll do that as soon as possible, thanks. – Sammy Guergachi May 27 '14 at 17:20

0 Answers0