How to get the location of the JMenuItem on the screen in actionPerformed

How can I get the location of the JMenuItem on the screen in actionPerformed.
When I use the function getLocationOnScreen() on JMenuItem or the object retruned by getComponent() I get IllegalComponentStateException.
I have figured out that inside actionPerformed the parent of the JMenuItem which is JPopupMenu (that contains the JMenuItem) is not visible anymore (its isVisble() function returns false).
Then how can I get the location on the screen of the JMenuItem or it�s popup menu such that I can use it in subsequent call to SwingUtilities.convertPoint(JMenuItem, int x, int y,frame), as I need to display a modal dialog box relative to the position of the popup menu in it�s frame.
Regards,
Janusz

Thanks for reply.
Unfortunately I have to figure out the location of the menu from within actionPerformed handler. At that point of time it is too late to overwrite JMenuItem. I probably could do some severe surgery in the code to implement my own JMenuItem derived class & overwrite processMouseEvent and pass the location attribute somehow to actionPerformed handler � but I am looking for some solution that would not require changes to the code outside actionPerformed handler.

Similar Messages

  • I've lost a load of notes, but dont know why or how to get them back. I cant find the folder that is in my Yahoo account that people have suggested might be the location for the messages.  I recently signed into iCloud for the first time.

    I've lost a load of notes, but dont know why or how to get them back. I cant find the folder that is in my Yahoo account that people have suggested might be the location for the messages.  I recently signed into iCloud for the first time.  Any idea how to get the notes back?   I really dont want to lose them.

    It should keep asking for the password, because it's trying to check for purchases... As soon as you login, it will see you have pending downloads and create the downloads section on the left below Purchases under the Store section. Then it will start the music downloads there, as they will be listed one below the other.
    You could just try to check your account balance or view your account and that will trigger a password request too. You can just click on that and say that now iTunes keeps asking for the password and ask him to help you with that. Trick would be to interrupt him so that he carries on with another task after, so he doesn't notice the download. Or you carry on with email or browsing which you were "busy" with when iTunes interrupted you for the password (stupid iTunes)

  • The location bar has disappeared from the top of any tab that I open. How can I get it back?

    The location bar has disappeared from the top of any tab I open, so there is nowhere to type in a web address. Could I have accidentally made this happen? How do I get it back?

    Just to be clear, it's not below the tab bar either? (That's the new style in Firefox 4 and 5.)
    To hide or show toolbars, you can use the old View menu.
    If you have the orange Firefox button, tap the Alt key to temporarily display the classic menu bar.
    View menu > Toolbars > ''check'' Navigation Toolbar
    If you are viewing the navigation toolbar but it's incomplete or corrupted, you can reset your toolbars.
    View menu > Toolbars > Customize
    In the large dialog with the icons, toward the bottom, click Restore Default Set.
    Does any of that help?

  • How to get physical number of selected row on the screen.

    Hi,
    We have block defined with Numbers of Records Displayed = 3. In the same time the data set contains 10 records. We would like to know how to get a number of row selected on the screen. i.e. in our case that the number will be always between 1 and 3 independent of the current row position in the data set.
    Best regards,
    Constantin.

    You can calculate that number by subtracting :SYSTEM.CURSOR_RECORD and GET_BLOCK_PROPERTY('BLOCK', TOPMOST_RECORD)

  • A while ago i went to sync music onto my Ipod Touch. Not only did the computer erase my music i had no idea how to get it back :( I contacted Apple on the phone but the name was american and i found it really hard to understand him. How do i get it back!

    A while ago i went to sync music onto my Ipod Touch. Not only did the computer erase my music i had no idea how to get it back I contacted Apple on the phone but the name was american and i found it really hard to understand him. How do i get it back! i bought most of my music on itunes but i just dont have any idea where to go and whjat to do can any help me??
    Respond please!

    Depending upon what country that you are in (music can't be re-downloaded in all countries) then see if you can redownload your past music purchases (those that are still in the store) via the Purchased link under Quick Links on the right-hand side of the iTunes store home page on your computer's iTunes : re-downloading.
    If you are not in a country where music can currently be re-downloaded, then have you not got it on your computer and/or on a backup ? If not then you can try contacting iTunes support and see if they will grant you a re-download : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • Okay i had to install Itunes onto my new OS because window's Vista messed up on me and i can't get any of my old purchases back from my account such as music and movies any ideas on how to get them back (i do not have the folder that contains old items)

    Okay i had to install Itunes onto my new OS because window's Vista messed up on me and i can't get any of my old purchases back from my account such as music and movies any ideas on how to get them back (i do not have the folder that contains old items from the last itunes or anything from that OS because it had a virus and i just wanted windows 7)

    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Hope this helps,
    JD

  • How to get structure of IDOC into xi in the scenario is IDOC - XI - File

    hi XI Guys,
          When i want to Integrate SAP sys(IDOC) with File how to get structure of IDOC into XI, As we will define Data types in File -> XI -> File. Please send Step by Step process as i am new to Netweaver(XI)
    ThankYou,
    B.Pushparaju.

    When i want to Integrate SAP sys(IDOC) with File how to get structure of IDOC into XI
    >>>>
    import the IDoc under the imported object in your SCV. Note that import should be allowed for the SCV.
    As we will define Data types in File -> XI -> File.
    >>>>
    Ref. these blogs to help you out ..
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

  • How to get backed up data in iphone3gs when the phone is disabled

    how to get backed up data in iphone3gs when the phone is disabled

    can someone help? this is shaking my trust in icloud backups.
    i am on iOS 6.1.

  • How to get absolute path of a form within the Forms

    Aslam o Alikum (Hi)
    How to get absolute path of a form within the Forms 6i or 9i
    For example
    i am running a from "abc.fmx" from C:\myfolder directory
    can i get the form path 'C:\myfolder' by calling any any function from "abc.fmb"

    There is no direct call that will always work. What you need to do is call get_application_property(current_form). This may have the full path in it, depending on if that path was defined when the form was launched. If there is no path, then you need to use TOOL_ENV.GETVAR to read the Forms<nn>PATH and the ORACLEPATH, parse those out into individual directories and then check for the FMX in each.
    I already have some code to do all this for you see:
    http://www.groundside.com/blog/content/DuncanMills/Oracle+Forms/?permalink=4A389E73AE26506826E9BED9155D2097.txt

  • Helo. How to get my security questions because i forget the question.

    Helo, How to get my security question because i forget the answer. Please help me.

    Go to https://getsupport.apple.com ; click 'See all products and services', then 'More Products and Services, then 'Apple ID', then 'Other Apple ID Topics' then 'Forgotten Apple ID security questions'.

  • Does anyone know how to get a white line across text like the USA basketball logo?

    does anyone know how to get a white line across text like the USA basketball logo?

    Draw the shape which is to be knocked out (a line in the example) in a layer above the logo. The colour doesn't matter because it will be made invisible.
    Double-click in the space to the right of the layer's name in Layers panel to open its Layer Style window where advanced blending can be modified.
    Set Fill Opacity to zero and Knockout to "Deep" or "Shallow" depending on whether the knockout should be limited to a containing Group.

  • When I'm on an app, on iso7.1 it will now show the "iPad/iphone" sign the time and the battery whilst running in an app. does anyone know how to get rid of that as its effecting the games i play.

    when I'm on an app, on iso7.1 it will now show the "iPad/iphone" sign - the time - and the battery whilst running in an app. does anyone know how to get rid of that as its effecting the games i play.

    If you can hide the status bar, it would be an option inside the app. I have one or two apps where that is an option but in most apps it is not.

  • How to get 11.02 (26) to look like the old itunes

    I can't figure out how to get 11.02 (26) to look like the old itunes, the new itunes is so cluttered. I hate it.

    I think your JTable is editable and thats why it fails to work.
    The above code will work onlyfor non editable table.
    I think the default setting for editable table is like that.
    Let some one else gives you the answer for editable one.
    Cheers !

  • The location should be active for the assignment error

    Hi All-
    I am trying to apply for the job Application: Review Account IRC1548607 using Oracle's online recruiting tool but getting the following error when hit next on the very first screen:
    "The location should be active for the assignment error"
    Anyone here help me resolve the issue?
    Cheers,
    Irfan Jaffery

    Hi Irfan Jaffery,
    Kindly provide the steps which has been performed while applying for the job and provide the exact error message and Error number.
    Thanks and Regards,
    Joshna.

  • Will apple next update to help fix the location following data problems will the ipod touch 2g be included ?

    will apple next update to help fix the location following data problems will the ipod touch 2g be included ?

    Chances are the 2g itouch will not be included in the update. Also no one yet knows if it will be fixed in the next firmware but apple has said they know of this bug.

  • My location service is not working from the day one the response is that (cannot able to determine the location) .What can i need to do to see my location in maps and other application even the location services is enabled in the settings?

    From the day one the response is that (cannot able to determine the location) while using ios5.1 .What can i need to do to see my location in maps and other application even the location services is enabled in the settings?.Which means that is there is any problem in my ipad ? currently running on IOS 6.

    Your location is determined from a location database which contains the MAC addresses of routers and their physical location. A MAC address is a unique number which is built-in to all network devices when manufactured. The database is built and updated by actually driving around and mapping router locations.
    Since you just moved the location of your router has not been updated in the database and when you use Maps you will see your old location.
    If you go outside your house you can be correctly located because your iPod sees other routers which are in the location database. Note that you do not need to be connected to a router for your iPod to see it and obtain its MAC address.

Maybe you are looking for

  • Importing XML Data Back into the Form

    I have a form that shows several subforms based on the selections the user has made while filling in the form. This is working quite well but when I import the XML data back into the form it doesn't show the subforms that have been used. Is there an

  • Enlarging Photo Viewer In iWeb

    The current max size is 600x800. Does anyone know how to make it larger, like 1024x768 etc.. Not using .mac to publish. I can see the code, but it won't allow changes (or will it ??) Thanks, Paul

  • Issues with XCode

    I was typing this in XCode (I had just gotten to the end) when this error comes up. A similar error also appears when I try to backspace over a double-slash comment if the comment is the first line. What does the error mean and why is it coming up? B

  • Printing a file

    hello, i am trying to use the javax.print package to print a file. The following is my code: import java.net.*; import javax.print.*; import javax.print.attribute.*; import javax.print.attribute.standard.*; class t { public static void main(String ar

  • [JOB] 2 F/T Flex Roles in NYC to 175k (Financial Services)

    Full details here: http://wp.me/pTfw1-4X