event handlers sometimes not being called

Help
John B.
2009-05-03
2013-05-23
  • John B.
    John B.
    2009-05-03

    I have a very normal menu setup for my program, but I tried it on the 64 bit HP workstations running Linux in the CSU lab today and sometimes the last few items on the menu don't generate events.  Always the elements at the end of the menu (it's a submenu of a menu actually).  The event handler only gets called about 50% of the time for those (I have to click the menu repeatedly to eventually make it work).  It smells like a race condition. Since the event handler method is never being called it appears to be in a library (?).  I could swear it worked on my Windows machine (don't have it with me though).  And to make it worse, my partner on the project can't reproduce it when he logs into the lab machines.  But if it were a race condition that might happen.  We are using the same JRE version.  Do I have to synchronize any of my functions to use Buoy?  Any suggestions would be greatly appreciated.  I'm befuddled.

    Thanks!

    - John

     
    • John B.
      John B.
      2009-05-03

      Gaa!  okay, figured it out.  It appears to be the windows manager.  Evidently there are problems between either Buoy or Awt/Swing and Gnome but not Fluxbox.  I'm using menus in a very traditional manner so I don't think it's my code interacting poorly with Gnome.

      So, then my question becomes what is the right track of action now?  Not sure how to narrow it down from here so I don't know who to report the bug to.

      Thanks again,

      - John

       
      • Peter Eastman
        Peter Eastman
        2009-05-06

        The first thing to check is that you aren't using multiple threads to interact with the GUI.  If you are, that can potentially cause problems like this.

        Assuming that's not the case, can you put together a simple example that demonstrates the problem?  Can you get it down to a trivial program that does nothing but create some menu items, add event listeners to them, and print out a message when any of them is selected?

        Peter

         
        • John B.
          John B.
          2009-05-06

          At the point in time that the bug occurs, only the event dispatch thread is running in my code.  I can try to put together an example, but odds are I'll be studying for finals, graduate, and loose access to the lab before I get around to it, so no guarantees ;)  And I don't run Linux at home.  But if I do anything with the project in the future I'll try to get it tested on Linux for sure.  However, if anyone else wants to try it I'll gladly supply the source code (it's GPL).  Please don't judge me too harshly, though, it was a semester end project and we had to speed through the last half of it for the deadline, so some of it turned into spaghetti and commenting could be very much improved ;)

          - John

           
    • John B.
      John B.
      2009-05-04

      Gaa!  okay, figured it out.  It appears to be the windows manager.  Evidently there are problems between either Buoy or Awt/Swing and Gnome but not Fluxbox.  I'm using menus in a very traditional manner so I don't think it's my code interacting poorly with Gnome.

      So, then my question becomes what is the right track of action now?  Not sure how to narrow it down from here so I don't know who to report the bug to.

      Thanks again,

      - John