Showing visible JPopupMenu in different location does not appear

In my application if a popup menu is already displayed and the user right clicks to reshow the popup menu in a different location the popup menu disappears. I have included a very simple sample app below that shows the problem.
Any suggestions as to what I'm doing wrong gratefully received.
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;
public class Test extends JFrame implements MouseListener {
  public static void main(String[] args) {
    Test test = new Test();
    test.setVisible(true);
  JPopupMenu popup;
  public Test() {
    super("Test");
    popup = new JPopupMenu();
    popup.add("Test1");
    popup.add("Test2");
    setSize(400, 300);
    getContentPane().addMouseListener(this);
  public void mouseClicked(MouseEvent e) {
  public void mouseEntered(MouseEvent e) {
  public void mouseExited(MouseEvent e) {
  public void mousePressed(MouseEvent e) {
    popup.show((Component)e.getSource(), e.getX(), e.getY());
  public void mouseReleased(MouseEvent e) {
}

Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html#popup]How to Use Menus. It shows a better way to check if a popup should be displayed.

Similar Messages

  • When I import my photos from my iPhone 4S into iPhoto the location does not appear.  I have to open the info button on the photo click "photo place" then "find on map" and then the location appears.  How to I get the location to appear automatically?

    When I import my photos from my iPhone 4S into iPhoto the location does not appear.  I have to open the info button on the photo click "photo place" then "find on map" and then the location appears. How to I get the location to appear automatically when I import my photos from my iPhone?

    in your iPhoto preferences is look up location set to "automaticaly"?
    LN

  • I am not able to download a charter toolbar it show up as being downloaded but does not appear on the homepage

    I have been trying to download a charter toolbar but it does not show up on the homepage along with the other toolbars. When I go to tools it does appear on the add on tab.

    How can I Add Extra Toolbars?
    https://support.mozilla.com/en-US/kb/how-do-i-customize-toolbars?#w_how-can-i-add-extra-toolbars
    Check and tell if its working.

  • One field is visible in print preview but does not appear when printed

    Hi,
    We have a batch job that creates the spool, but one field of the form is visible during print preview of the spool but is NOT visible in the print out.
    How do we solve this?
    Is there an error in the printer?
    Thank you!
    Rgds,
    Freishz

    Hi guys,
    The catch is, when re-printed, it already appears. But after the batch job has been completed, this does not automatically appear.
    This involves, output type of a delivery.
    Thanks for your reply!

  • When adding a bookmark the location menu does not appear.

    Firefox 10.0.2 on Ubuntu 10.04 - when I add a bookmark the secondary menu (which allows you to choose the location) does not appear. The bookmark is created in the main bookmark "folder". I can manage the bookmark after it is created but this is not very efficient.
    Any ideas how to correct this? Thanks in advance.

    Hi,
    Please check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode.]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [http://support.mozilla.com/en-US/kb/Uninstalling+add-ons Uninstalling Add-ons]
    [http://kb.mozillazine.org/Uninstalling_toolbars Uninstalling Toolbars]

  • HDMI does not appear in playback

    I have no audio when I connect my HP Pavilion dv4-1435dx Entertainment Notebook PC to my Panasonic TV via a HDMI cord.  The picture is great, but audio will only go through my laptop speakers.  I have updated all of my devices, I have tried using Intel's website to verify I have all of my drivers updated.  I have also checked on my playback to show all disabled devices and HDMI does not appear.  I have uninstalled and reinstalled to no avail.  I have even verified that the settings on my TV are set to digital audio.  I have tried uninstalling the Intel High Definition Audio HDMI, plugged the HDMI cable to my laptop with the TV off, reboot and still no luck!!  The only options I have for playback are "Speakers and Dual Headphones", "Independent dual headphones", and "SPDIF"  My computer is an upgrade from Vista to Windows 7 64-bit.  I am getting way too frustrated over this and have searched every forum imaginable for a resolution to this issue, please help!!

    Hi,
    Try this to see if it helps.  Download the Chipset driver and Graphics driver on the links below and save the installers to your Desktop.
    Chipset Driver
    Intel Graphics Driver
    Next, in Device Manager, open Display Adapters, right click on the Intel graphics chip and select Properties.  Click the Driver tab and then select uninstall.  When done, do the same for the for the Intel High Definition Audio CODEC and the IDT High Definition Audio CODEC, found under Sound Video and Game Controllers.
    Now return to the Desktop and install the Chipset driver and then the Graphics driver.  When complete, reboot the notebook and see if this has helped.  Check in Device Manager that both the Intel Graphics and the Intel Hi Definition Audio codec have reinstalled successfully and whether you now see the HDMI Audio option under playback devices ( found in Control Panel, Sound ).
    If it shows up correctly, try the HDMI connection and see if it now functions properly.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • How come my external hard drive is no longer visible in finder even after ticking it in preferences? it shows in the disk utilities but does not allow me to find a problem or fix the problem? Please help.

    it shows in the disk utilities but does not allow me to find a problem or fix the problem? Please help. also my external hard drive is a seagate free agent go, 500GB. it is visible on my tv but has no files in it… i'm scared i've lost everything?

    Honestly i cannot remember sorry, i got it like 5 maybe 6 yrs ago and just started downloading things to it as the memory on the computer started filling up and when i wanted to see photos/videos on my TV.
    My wife did tell me after i had written this post that she did try and record TV to it as it was plugged in. I think by doing so somehow has deleted everything.   It reads on my TV yet has no files in it but won't show up on my computer. hope this helps.
    Starting to think it is going to cost more to retrieve files on it than it will be to buy a newer and larger one.

  • HT4972 IN GPS my location does not show exactly, how can i make it exact location showing by my iphone

    In GPS my location does not show exactly, how can i make it exact location showing by my iphone

    If rebooting doesn't fix things, go through the troubleshooting steps here:
    iOS device not recognized in iTunes for Mac
    iOS device not recognized in iTunes for Windows

  • I have Photoshop elements 10 and have been trying to copy albums onto a flash drive to show slide show on my TV. 10 does not have a flash drive connection, so I am trying to put it on my harddrive. When I hit the export to harddrive or anything else, I ge

    I have Photoshop elements 10 and have been trying to copy albums onto a flash drive to show slide show on my TV. 10 does not have a flash drive connection, so I am trying to put it on my harddrive. When I hit the export to harddrive or anything else, I get a message saying it is trying to locate and reconnect missing photos, goes into a search mode and displays the identifiers of the located images. When I try to follow the directions for reconnecting I get nowhere. Can you help?

    Wrong forum; we don't do Elements here.
    You want:  Photoshop Elements

  • The storage where the virtual hard disk is located does not support virtual disk sharing

    Hi everyone,
    I deployed 2 hyper v vitual machines a while ago, and i did that because I needed to test my current game Project, which is an
    online game. However, i've had some problems with my Windows installation then I had to reset the pc by making it a refresh
    install. I still have the hyper v virtual disks, but i cannot attach it to a new hyper-v virtual machine. it pops up this message:
    "the storage
    where the virtual hard disk is located does not support virtual disk sharing". I dont know anything about virtual machines, so I
    didnt know I had to make the disk sharable. How can I force to attach the hard disk to a new hyper-v? I dont want to go t
    hrough the whole proccess of installing the operating system all over again and updating it....
    Any help is greatly appreciated!
    Thanks in advance,
    Romulo Romero

    Hi MrDebugging,
    >>
    When I Try to add a SCSI Controller, and then I click browse to add a UNC I get this:
    C:\Users\Public\Documents\Hyper-V\Virtual hard disks\ClienMachine.vhdx
    but I tried placing in different location, and the same problem occurs!
    By the way, Im not on a server , I am a domestic user and I am running it on my
    Windows 8.1
    According to the error message , it seems that it is not a permission issue .
    The VM is Gen 1 or Gen2 ?
    Generally the error message occurs when you enable "shared vhdx" on standalone/client hyper-v host :
    Please try to attach the VHDx file to IDE controller if it is a Gen 1 virtual machine (because only the SCSI controller has the option "virtual hard disk sharing" and Gen 1 VM only can boot from IDE )
    All in all , please do not use this feature without CSV or Scale-Out File Server with SMB 3.0 on file-based storage .
    If it is not the case , please detail steps what you did .
    Best Regards,
    Elton Ji
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] .

  • I'm using windows 7, trying to download pictures from my canon 5d mark 2, but when I click import, the camera does not appear. I've tried changing USB ports, switching the camera on and off, trying a different USB cord, tried a different camera, but nothi

    I'm using windows 7, trying to download pictures from my canon 5d mark 2, but when I click import, the camera does not appear. I've tried changing USB ports, switching the camera on and off, trying a different USB cord, tried a different camera, but nothing. Please help! This problem only started a few days ago on lightroom 3.6, upgraded to 5.5, but still not working. Thanks.

    Can you see the Canon EOS camera and image files using Windows Explorer? If not disconnect the camera, close all applications' shutdown Windows, and TURN OFF the power to your system and ALL connected devices. Disconnect all phones, iPads, and any other USB devices and restart your system.
    Retry Windows Explorer and see if your camera is showing. If so try LR import again.

  • Tv shows menu does not appear in ATV 2

    The 'TV shows' menu item does not appear in my brand new Apple TV 2.  I have rebooted a couple of times.  Any help appreciated

    Thanks for the answer.  After more research I realise that as I'm in Australia and there are no TV show rentals here that is why there is no TV Shows menu item.  This is despite the fact that the Australian AppleTV 2 site shows a screen shot of the Apple TV menu with 'TV Shows' on it.  When you read the text it does not mention TV shows. What I find most annoying is that there doesn't seem to be a way to access the Itunes store from the ATV2.  With ATV1 I could watch a TV show and if I wanted to immediately buy the next episode or the whole series I could do so from my ATV1 iTunes interface.  Now with the new ATV I can watch a show through home sharing if I have already purchased it but if I want to buy the next show I have to get up from the TV room, go to the study, buy the show on my iMac and then wait for it to download to stream to my ATV2.  Is this user friendly progress?
    While I understand that ATV2 is for rentals and that there is no hard drive storage, I can't believe that Apple couldn't come up with an interface that allowed the ATV2 to access and browse the iTunes store and then download purchased items to the iMac for streaming.
    As a, hopefully temporary, solution I have reconnected the ATV1 to a different HDMI input, and synced only unwatched TV shows.  This will allow me to then purchase new shows (or movies), which will be stored on iTunes for later streaming via ATV2.
    Am I missing something or is this the only solution?

  • I have an iPhone 3gs and it used to show up on my computer, but now it shows up on my screen that it is charging however, does not appear in iTunes or My Computer so i can't sync it. Can anybody help? Thanks

    I have an iPhone 3gs and it used to show up on my computer, but now it shows up on my screen that it is charging however, does not appear in iTunes or My Computer so i can't sync it. Can anybody help? Thanks.

    Did you already make sure that Apple Mobile Device Service is installed and active on your computer?
    http://support.apple.com/kb/TS1567
    More troubleshooting about your device not recognized in Windows can be found here: http://support.apple.com/kb/TS1495

  • I really need someone to help me. I have been trying to figure out how to select a PDF document to convert to a Word doc. When I go to select a PDF file, all that shows up is the WORD docs. does not show ANY of my PDF files... Please help me figure out wh

    I really need someone to help me. I have been trying to figure out how to select a PDF document to convert to a Word doc. When I go to select a PDF file, all that shows up is the WORD docs. does not show ANY of my PDF files... Please help me figure out what is going on? We have it set on auto renewal so I know its not that we haven't renewed this subscription, because we pay automatically.

    Hi olivias,
    It sounds like there may be some confusion on your system about what application should be associated with PDF files. You can reset filename associations by following the steps in these articles (depending on your operating system):
    How to change the default application for a file type | Macworld
    http://windows.microsoft.com/en-us/windows/change-default-programs#1TC=windows-7
    Please let us know if you have additional questions.
    Best,
    Sara

  • HT1688 I have a honda civic with USB port which allows play back of my old iPhone 4 and 4s.  With the new iPhone 5 the radio shows the phone is conected but does not show any music content.

    I have a honda civic with USB port which allows play back of my old iPhone 4 and 4s.  With the new iPhone 5 the radio shows the phone is conected but does not show any music content.  Any Suggestions?

    You should be syncing your contacts with an app on your computer or cloud service (iCloud, Gmail, Yahoo, etc), and not relying on a backup.  If you haven't been doing this, start now and then restore your old backup.  You will then be able to sync the new contacts back into the phone.  However, you will lose all messages, etc newer thant the backup.

Maybe you are looking for

  • Unlinking two iPhones that currently have the same Apple ID

    My parents accidentally used the same Apple ID for both of their iPhones. How can I unlink their accounts and create two different, unique Apple IDs for each of their iPhones? And without losing what is currently saved to the iCloud (some of the info

  • ITunes is freezing when I try to send music to my airport express

    Hi, I'm uwing a desktop with W7 (32bits) and iTunes 11.1.2. I can play music with iTunes without any problem but when I select my airport express, iTunes freeze. I am sur my airport express is working properly because I can use it with my iPad. I hav

  • Functions in Calculated Keyfigure and New Formula

    Hello All I want to know each and every functionality(Under functions)in Calculated Key figure and New Formulae? do anyone has docs., on this,if so pl forward to my id   [email protected] regards balaji

  • ODBC access to LMS DB doesn't work

    I have an application that returns 'provider not found' when trying to connect to the 'CiscoWorks embedded database'. The dbodbc10.dll files were copied over from the LMS server and registry entries made per the manual. The system Dsn was set up and

  • User's not receiving notification's

    Dear All some user' are not receiving notification's in their Home in page. user's has submitted many request but not receiving notifications. I have check their email address are also updated in the system. preferences has also set as 'do not send m