MouseEvents are not triggered for JMenu

I would like to listen for MouseEvents but i'm not sure if it is a bug in java or some lack of knowledge on my side concerning event handling.
I have a simple menu with one mouse listener and seems that mouseReleased and mouseClicked events are not triggered always as i would expect.
if i run the code that has been attached below, than i have the following strange scenarios.
Menu0 is not opened and click on it once:
pressed Menu0
clicked Menu0
There is no mouseReleased received. why?
Menu0 is opened and click on it once again:
pressed Menu0
released Menu0
clicked Menu0
Menu0 is collapsed and i have all the events. ok
Menu0 is opened and click on Menu1:
pressed Menu1
released Menu1
Menu0 is collapsed and there is no mouseClicked event. why?
Menu0 is opened and go over Menu2 and click on it:
pressed Menu2
clicked Menu2
There is no mouseReleased event. why?
Press the mouse over Menu2 and release it over Menu3:
pressed Menu2
released Menu2
why is it 'released Menu2' and not 'released Menu3' if it is pressed and released Menu2 than where is the clicked event anyway.
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
public class MouseEventTest
     public static void main( String[] args )
          JFrame frame;
          JMenuBar menuBar;
          JMenu menu, subMenu;
          JMenuItem menuItem;
          MouseListener mouseListener;
          mouseListener = new MouseAdapter() {
               public void mouseEntered( MouseEvent e )
               public void mouseExited( MouseEvent e )
               public void mouseClicked( MouseEvent e )
                    System.err.println( "clicked " + ((JMenuItem) e.getSource()).getText());
               public void mousePressed( MouseEvent e )
                    System.err.println( "pressed " + ((JMenuItem) e.getSource()).getText());
               public void mouseReleased( MouseEvent e )
                    System.err.println("released " + ((JMenuItem) e.getSource()).getText());
          menuBar = new JMenuBar();
          menu = new JMenu( "Menu0" );
          menu.addMouseListener( mouseListener );
          menuBar.add( menu );
          menuItem = new JMenuItem( "Menu1" );
          menuItem.addMouseListener( mouseListener );
          menu.add( menuItem );
          subMenu = new JMenu( "Menu2" );
          subMenu.addMouseListener( mouseListener );
          menu.add( subMenu );
          menuItem = new JMenuItem( "Menu3" );
          menuItem.addMouseListener( mouseListener );
          subMenu.add( menuItem );
          menuItem = new JMenuItem( "Menu4" );
          menuItem.addMouseListener( mouseListener );               
          subMenu.add( menuItem );
          frame = new JFrame();
          frame.setTitle( "MouseEvent test for JMenu" );
          frame.setBounds( 320, 240, 320, 240 );
          frame.setJMenuBar( menuBar );
          frame.addWindowListener( new WindowAdapter() {
               public void windowClosing( WindowEvent e ) {
                    System.exit(0);
          frame.setVisible( true );
}

Well there are differences across Operating Systems. For example I'm using JDK1.4.2 on XP. When I click on Menu0 I get:
pressed Menu0
released Menu0
clicked Menu0
It is always better to use a "higher" level event when possible. In this case you should be using an ActionListener, if you want to know when a menu or menuItem is clicked. Or maybe you could use a MenuListener to know when a menu is opened and closed.

Similar Messages

  • Release strategy not triggering for Specif plant

    Hi Friends
    I configured a release strategy with three charecteristics. P.org, Plant, Net value.
    this stretegy is triggering for specific plants which are under a particular company code, and if I change to my plant and P.org. its not triggering.
    I have deleted all the classifications and release strategies from, no other data in VV_T16FS_2 , AUSP,T16FV,and T16FS tables except this release strategies data.
    do we have any settings at cocode level??????
    please respond if answer known
    Points would be awarded for for your valuable answer.

    Thank you deepak for your quick respond
    Actually There were already release strategies  with same charecteristics, and with the values of other plants and other P.orgs which are under certain companycode.
    these were triggering perfectly for PO
    Now created new strategy for plant and P.org under different plant code of different cocde. this strategy not triggering for PO.
    but if the release strtegy  values replaced by the erlier plants and P.org  again its triggering.
    Now I created new chars, class, and stategies still same problem persists.
    Release stategy working for the values of a prticular company code plants, Porgs.
    and already tried your suggestion Cocode as char. but same its working for only that company code not for my companycode

  • My Customized Workflows are not triggering

    Hi All,
    I customized workflows.But in SWEL my all customized workflows are not triggering from the last two days..Before it was working..In SWE2 also done properly and SWU3 also fine.
    Please give suggession whereis the Problem?
    Regards,
    Soni

    If you look at the details of your event linkage entry (transaction SWE2) you will find that the "Check function module" field is not empty. The function module, when executed for the event you created, raised an exception - which is the standard way for a check function module to prevent a workflow from starting.
    The check function module could be one set up for a workflow start condition, namely SWB_CHECK_FB_START_COND_EVAL. If so, check the workflow start conditions for your workflow (transaction SWB_COND).
    Otherwise, examine the check function module's code to determine what it checks and why it prevents your workflow from starting.
    <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/c5/e4b027453d11d189430000e829fbbd/content.htm">SAP documentation: Using (event) linkages</a>

  • New DSO data fields are not available for transformations in the upwardflow

    Hello,
    There are data flow from
        many source DSOs -> Target DSO -> Final DSO.
    Different transformations are defined and activated with DTPs. This works fine and provides the desired results.
    now new fields are added to the target DSO, final DSO and one of the source DSO.
    When I now try to edit the transformations, the new fields are not part of the sources at the different stage.
    The fields are available in the Data Source created out of a DSO but not directly when using a DSO as a data source.
    Have anyone faced such a problem?
    any solutions to this?
       - I cannot delete all the other transformations as this is too much work to do and there is no time for it.
    Regards
    Kannan

    We created ZMD_BS_MAT_OVP_LAYOUT. But the situation has not changed - the fields are not available for edit.

  • Payment method(s) are not allowed for this program / Program RFFOAVIS_FPAYM

    Dear Friends,
    In Se38  abap editor, I entered the program RFFOM100, i entered the details program run date,identification future,paying company code,payment methods T, House bank, Account Id and executed the program. I am getting the error 'Payment method(s) are not allowed for this program'.
    Payment method S is not used in F110, It was not mentioned in vendor master or vendor invoice.It is not mentioned in fbzp in bank determination. When i tried to delete payment method 'S' the system shows a message Payment Method S is being used in the company code.
    In  the program RFFOAVIS_FPAYM, i entered the details program run date,identification future,paying company code,payment methods T, House bank, Account Id and executed the program. I am getting the error  'Program RFFOAVIS_FPAYM: No records selected'. But there open items or invoices.
    Please suggest how to resolve the errors.
    Regards
    Sridhar

    Hello,
    Why are you directly executing these programs?
    You will not expect these program to execute directly by going to SE38.
    I would have configured the relevant payment methods in the country with DME structure or classical RFFO* programs, which in turn pick up the inherent programs at the time of running F110.
    For example, if you need to generate BACS file for country GB, either you copy the GB_BACS to ZGB_BACS or use GB_BACS directly in FBZP settings.
    Make sure that you have maintained OBPM1 / OBPM2 / OBPM3 and OBPM4 settings properly.
    The system automatically gives the access to system RFFOAVIS_FPAYM. Prepare a variant against this program in F110. Relevant file gets generated to folder path mentioned in OBPM4 will get generated. The file get generated can be seen in AL11.
    Hope this is informative and solves your issue.
    Regards,
    Ravi

  • Line items are not appearing for some users

    Hi
    In one module pool program some line items are not appering for specific users. For Ex: Out of 5 line items user1 is able to see only 3 and user2 able to see all the line items. what might be the reason.
    Regards
    John.

    Hi,
    What do you mean by line items? Are you talking about screen fields in your module pool program or output of the program?
    Please clarify your issue.
    Regards,
    RS

  • Payment order are not defined for extended withholding  tax

    Hi Gurus,
    Would you please help me with the message below. It appears on F110 when I try to pay a vendor open item with extended withholding tax:
    Message FZ626 -Payment orders are not defined for extended withholding tax
    In my company payment orders are created in F110 for accounts payable, as we use another ERP system (Baan) to perform the local accounts payments, and now I've just activated Extended withholding tax functionality With accumulation (necessary in Brazil) but I get this error.
    Is it not possible to user payment order with extended withholding tax + accumulation? I find it hard to believe...
    I've tried to unflag the payment order only for the payment method I'm using in FBZP t.code, but then no payment order were created but instead a payment document were posted with the withholding tax accumulation, but this is not the way we are working, and nothing is sent to Baan
    any help is welcome

    The payment method "Y" the option "payment order only" was marked?
    For a withholding tax type with accumulation in a company code with extended withholding tax payment
    methods that create only payment orders can´t be used. Payment orders can only be created only if there are
    no tax types with accumulation involved in the paid items of the payment run.
    The functionality extended withholding tax works fine for Brazil
    however, you can´t use the payment order with this functionality.
    Please, review your customizing for payment method 'Y" in transaction
    FBZP.
    Best regards,
    Leonardo Vedovelli
    FI Support Engineer
    SAP Active Global Support

  • Every movie purchase through iTunes fails to transfer to my iPhone or iPad and the message I get is this: some of the items in the itunes library, including were not copied to the ipad because you are not authorized for them on this computer... help?

    For a couple months now, every movie purchase through iTunes fails to transfer to my iPhone or iPad giving me the error: "some of the items in the iTunes library, including were not copied to the iPad because you are not authorized for them on this computer". I have read many forums about deleting, reinstalling, de-authorizing and authorizing my iMac through the iTunes store. Many suggestions don't work except to rename the movie to *.MP4 in Finder under the iTunes movie directory. I imagine this is a setting or a bug somewhere... any suggestions on how to bypass having to rename the files in Finder? My research into Google suggests this problem dates back to 2007 or so but it is now more prevalent than ever.
    Thanks.

    Try:
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases

  • Message no. 8I766 Number Ranges are not maintained For Extended Withholding

    Dear All,
    I am facing the following problem when i am trying to generate the withholding tax certificate
    1.) Message no. 8I766 Number Ranges are not maintained For Extended Withholding Tax 
         Number Ranges are not maintained for Business Place and Section. Check entries in tables J_1iewt_cert  (for Business Place) or J_1iewt_cert_n (for Section Code) and j_1iewt_certno  in EWT.
    I have checked all the above tables and found that the entries are maintained
    2) When i am trying for print priview and then print its generating spool request and the certificate is getting saved -
    > here the following problems are faced
          A) . TDS Number is not coming
          B).Details Of the tax deductor ( Name , Adress , TDS Circle , TAN & PAN is not coming Where       to update these details
          C) In Amount Paid / Credited Column - Some fixed amount is comming irrespective of the actual amount credited
    Please help me in soving the above issues
    Thanks & Regards
    Arun.R

    Hi
    You need to maintain Section Code wise number range . Go to Sm30 Select Table J_1IEWT_CERT_N and maintain it.
    Thanks
    GG

  • Lines are not generated for holidays and sundays

    Hi
    creating a sale order shcedule lines are not generated for sunday for a particular plant .
    Schedule lines are generated for subsequent monday only.
    the plant calander  is also  correct
    with regards
    partha

    Hi
    I would really double check the factory calendar ans the  of the plant and sales organisation
    regards,
    Sidi

  • Excise Details are not maintanied for Vendor 0000000957.

    Hi,
      As per our regular process  we are capturing inovie with J1IEX  and doing GR in MB01   now i have captured  invoice in J1IEX  and while making GR with MIGO i am getting error
    Excise Details are not maintanied for Vendor 0000000957. ,  but when i am making GR with MB01 i am not getting any error.
    also what configuration required to capture excise invoice and make Gr in MIGO,  as capture excise invoice menu is not coming in MIGO  in MIGO Exicse tab i can only see  only  refer excise invoice  ,  only part1 , no exicse registration.
    regards,
    zafar

    Hi,
    Do proper setings in Logistics - General -Tax on Goods Movements -India -Basic Settings -Maintain Excise Groups  - select your excise group and check settings in MIGO Settings such as EI Capture, Post EI in MIGO, Duty different at GR.
    Also ensure that you have maintained excise details for Vendor and Material in J1ID.
    Regards,
    Vikas

  • I was trying to sync my itouch with my new mac, and some songs won't download because they are not authorized for this computer. But even after my computer was authorized they still won't sync. How do I fix this?

    I was trying to sync my itouch with my new mac, and some songs won't download because they are not authorized for this computer. But even after my computer was authorized they still won't sync. How do I fix this?

    I have the same problem. It is only with tv shows and only with programs I have downloaded after the software update.
    Apple support sent me the above link too....but it doesn't solve the problem...my computer is authorized and the content is in my library and will play on my Mac air, but it will not sync the tv shows, it keeps saying my computer isn't authorized for it.
    No answers here, but you are definitely not alone with this issue.

  • Depreciation posting rules are not define for area 00 in company code

    Dear Expert,
    Would like to seek for help, when I run a customize report (AUC without PO not yet capitalized report the system prompt the error depreciation posting rules are not define for area 00 in company code only on the march 2011 on ward but before march 2011 the report is able to display as usual.
    Between., does SAP have the standard report to list the asset which is AUC and not yet capitalized?
    My version of SAP is ECC 6.0.
    Kindly advise.
    Regards,
    Karen

    Hi,
    Thank you for the prompt reply, why the system prompt the error depreciation posting rules are not define for area 00 in company code only on the march 2011 on ward but before march 2011 the report is able to display as usual?
    Please help.
    Regards,
    Karen

  • I made the mistake of resetting my iPod to factory defaults. Now it will only partially sync to my music library. I continually get an error message saying that certain songs are not authorized for my computer. Any ideas?

    I made the mistake of resetting my iPod to factory defaults. Now it will only partially sync to my music library. I continually get an error message saying that certain songs are not authorized for my computer, although they are in the iTunes library on the computer and will play. It's these songs that won't transfer to the iPod. I have deauthorized and re-authorized the computer but no joy. Any ideas?

    Hello there DesertRat71,
    I was thinking that some of the songs in your library may have been purchased under a different apple id. You have already done the first thing I would have done by de authorizing and re authorizing. To verify this, highlight one of the songs that will not sync over and use File>Get Info. Here is the help menu link for it if you need it help://bookmark='https://help.apple.com/itunes/mac/11.0/help/index.html?localePa th=English.lproj#itns2937'
    In the Summary section there will be an Apple ID entry. If it shows something different than what you are currently using then I recommend signing into the Apple ID it shows and authorizing the computer for that one as well.
    All the best,
    Sterling

  • Exchange rate diff. accts are not defined for account 16145110currency INR

    Dear SAP Gurrus,
    I am facing a problem while making  payment against invoice, receiving payment against invoice, clearing advance payment and  advance receipts through T-code F-53, F-28, F-44 and F-32.  System is allowing me to select the invoices against which I want to do the clearing but when I go for simulation I am getting the following error -
    ' Exchange rate diff. accts are not defined for account 16145110currency INR'.
    When I click on the error message the performance assistant gives methe following details:
    Exchange rate diff.accts are not defined for account 16145110 currency INR
    Message no. F5062
    Diagnosis
    The accounts for posting the exchange rate differences could not be determined. For the specified G/L account and the specified currency key, no corresponding exchange rate difference accounts were determined.
    System Response
    The system cannot generate the exchange rate difference posting.
    Procedure
    By pressing ENTER, you achieve that the document is reset to a status without automatic posting. In another window, you can complete the default settings for exchange rate differences and post the document afterwards.
    Proceed
    My client is local. Even the local currency is set to 'INR'. There is no foreign currency involced while making invoices, payment and receitps.  Eventhough the system is giving me error.  As a result I am not able to clear open items. Please give me some feasible solution so that I can clear the open items.
    Thanks in advance
    Regards
    Shreyas Wani

    hi,
    As you said, you are not maintaining any Exchange rate differences, It may not be required a Exch rate Diffrences account.
    Please check whether you have created any Group / Parrallel curencies etc in co.code level.
    Please go through the notes 209580 / 89531, hope it helps you.
    Regards
    Kanna

Maybe you are looking for