Java swing popupmenu / context menu does not appear in secondary monitor

Main screen left
second screen right
swing portal application is visible on two screens.
If you open a context menu (right mouse) on the right screen, the context menu open on the left (Main) screen instead of the right.

Thank you very much for the replying.
The below are my use cases :
1. JDK 7 used.
2. OS - Ubuntu/windows XP/2008
3. Tested with extending more than 1 monitors, i.e. Laptop / primary monitors are attached with other secondary monitors attached and then running swing portal        application.
4. This happens when you use "Extended Desktop" with two screens.
    Main screen left
    Second screen right
    Portal is visible on two screens.
    Open a context menu (right mouse) on the right screen, the context menu open on the left (Main) screen instead of the right
The below is the sample of code of the file that actually open up the popups. The bold italics methods are the call hierarchy that are responsible to finally call the showPopupMenu().
private synchronized void handleMouseEvent( final IDirNodeMouseEvent e ) {
        if ( e.getMEvent().isPopupTrigger() ) {
            Thread thread = new Thread(
                    new Runnable() {
                        public void run() {
                            JNDITreeNode node = (JNDITreeNode) e.getNodeAtEventLocation();
                            System.out.println(" --- handleMouseEvent ---");
                            createPopupMenu(e.getMEvent().getPoint(), e.getMEvent().getComponent(), node);
            thread.start();
private synchronized void createPopupMenu(final Point point, final Component c, JNDITreeNode node) {
        contextMenuDN = node.getDn();
        CursorHelper cursorHelper = CursorHelper.showWaitCursor(c);
        com.marconi.platform.cvb.bcmp.security.AbstractDNPanel.registerJndiTreeNode(node);
        ContextMenuFactory contextMenuFactory = new ContextMenuFactory ( context );
        contextMenuFactory.setAttributeViewDisplayText(node.getDisplayText());
        TreeNodeDescriptor treeNodeDescriptor = new TreeNodeDescriptor(
                node.getDn(),
                node.getDirData()
        boolean searchContextAvailable = true;
        JNDIData data = node.getDirData();
        Attributes attrs = data.getAttributes();
        Attribute a = attrs.get("mSearchContextAvailable");
        try
          if (a != null)
                String value = (String)a.get();
                if (value.equalsIgnoreCase("FALSE"))
                    searchContextAvailable = false;
        catch (NamingException ne)
        jMenuItemSearch.setEnabled(searchContextAvailable);
        JPopupMenu menu = contextMenuFactory.getPopupContextMenu( treeNodeDescriptor );
        menu.addSeparator();
        menu.add( jMenuItemCollapseAll );
        menu.add( jMenuItemSearch );
        if ( contextMenuDN != null ) {
            menu.add(jMenuItemUpdate);
        MUtils.showPopupMenu(menu, point, c);
        cursorHelper.showDefaultCursor();
   * MUtils ensures that the whole popup menu is visible, performs a cleanup before showing.
   * @param popupMenu the menu to be shown
   * @param mouseClickPoint where the mouse has been clicked
   * @param c the component on which to show the popup menu
   * @see cleanupMenu
    public static void showPopupMenu( final JPopupMenu popupMenu, final Point mouseClickPoint, final Component c) {
    if ( popupMenu.getComponentCount() == 0 ) return;
    cleanupMenu( popupMenu );
    if ( autoAssigningMnemonics ) {
      assignMnemonics( popupMenu );
    final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    final Point result = new Point(mouseClickPoint);
    SwingUtilities.convertPointToScreen( result, c);
    Dimension popupSize = popupMenu.getPreferredSize();
    popupSize.height = popupSize.height + 30; // as Windows TaskBar is overlapping always
      if ( popupSize != null ) {
      if ( result.getX() + popupSize.getWidth() > screenSize.getWidth() ) {
        result.setLocation( screenSize.getWidth() - popupSize.getWidth() , result.getY() );
      if ( result.getY() + popupSize.getHeight() > screenSize.getHeight() ) {
        result.setLocation( result.getX(), screenSize.getHeight() - popupSize.getHeight() );
    result.x = Math.max( 0, result.x );
    result.y = Math.max( 0, result.y );
    SwingUtilities.convertPointFromScreen( result, c );
    javax.swing.SwingUtilities.invokeLater(
      new Runnable() {
        public void run() {
            popupMenu.show( c, (int) result.getX(), (int) result.getY());
Please let me know your feedback. Need to confirm whether this issue is really exists or not.

Similar Messages

  • Right click context menu does not appear only for Java 1.7, AWT TextField

    I have been debugging some issues that an application has been having with Java 1.7 versus older versions. A new problem I have encountered is that the right click context menu does not function in any TextField. It works fine when running/compiling it with any previous version of Java. I have tried coding a simple test with a Frame, Panel and TextField to see if it might be something else in the more complex application that was causing it, but the simple test class has the same problem.
    I have searched for other people having the same issue, but I have not found anything comparable. This seems like a huge change from one version to the next and I am surprised that I am not finding this mentioned anywhere else. Can someone point me to anything that discusses this issue that I am having? Does 1.7 require I implement my own context menu? I realize AWT is old technology, but this is an old, fairly complex application that doesn't use swing, and that is not going to change at this point.
    My simple test:
    import java.awt.*; 
    import java.awt.event.*; 
    import java.util.*; 
    class testF3 extends Panel 
      public static void main(String args[]) 
        Frame f = new Frame(); 
        Panel p = new Panel(); 
        f.setLayout(new BorderLayout()); 
        f.add("North", p); 
        TextField tf1 = new TextField("", 20); 
        p.add(tf1); 
        Dimension medm = f.getSize(); 
        medm.height = 100; 
        medm.width = 200; 
        f.setSize(medm); 
        f.setVisible(true); 

    In the past few days since upgrading to 4.0.4, the entire right-click context menu for links is gone and replaced with one item: "Copy Link" The "Open In New Tab" item, along with some other context items, is no longer there.
    That's actually a problem with your particular installation of Safari, b. I've got all the contextual menu entries with my 4.0.4.
    I helped fix one of these recently here at the forum. Try the procedure from the following post (it got back Tho's missing contextual menu entries):
    http://discussions.apple.com/thread.jspa?messageID=10598385&#10598385

  • Context menu does not appear on first row of apps

    If I invoke the context menu, using the keyboard (Shift+F10/context-menu key), on any app in the first row of its category, no menu appears. The same app, if moved to the second row by resizing iTunes shows the normal context menu.
    Does anyone else have this issue, on Windows or Mac?
    Message was edited by: Soumya92

    make sure you are running the latest update and that nba leauge pass is availible in your country (if not in the usa)

  • A context menu does not appear when I type the annotations

    I want to change the size and color of the pen, but can not get the context menu.

    Hi,
    Could you please try following steps and let me know if this helps.
    1) Open you pdf.
    2) Tap on pdf to bring the top bar.
    3) Tap on Comment icon.
    4) Choose pen.
    5) Draw the annotation with your pen
    6) Press Save
    7) Tap on your annotation.
    Here you will get the context menu that will allow you to change Thickness,color and opacity of your annotation.
    -mayank

  • MW64,  cs6 bridge when I move or copy files the  context menu does not retain  recent folder destinations after I close the program

    W64,  cs6 bridge when I move or copy files the  context menu does not retain  recent folder destinations after I close the program. The context options that show are the ones from original install. The workspace I set up is also gone. I have every explorer box and cleaner checked to save recent. Had to disable nivedia desktop software because of weird display conflict. Have Dell pro support and they cannot fix. Any ideas to help me with this would be appreciated.

    Self-solved!  I work in column view in Finder so get there in a Finder window with folders and files appearing.
    There really is no problem, just select an ITEM in the COLUMN before right-clicking!
    The "old" context menu will appear. If you click in the white space in that column (or anywhere in a Finder window) and then place the cursor over a folder or file WITHOUT selecting it and right-click you will bring up the secondary context menu - Open, Copy, Duplicate, View Options and a greyed out Labels option. No "Move to Trash".

  • The item Hierarchical Context Menu does not support pre-calculation

    Hello,
    Trying to download pre-calculated web templates via RepAgent, using the Hierarchical Context Menu feature within the template (populated via control query with Hierarchy) the system returned the following message upon file download:
    "The item Hierarchical Context Menu does not support pre-calculation"
    As a result the Hierarchical Context Menu is not displayed on the downloaded html-files. Navigation not possible.
    Could not find any constraints documented in the online help, at this point.
    Question: is there something missing on our setup or is this really out of scope for precalculation with navigation?
    Any other experiences on that or shall we open OSS-message?
    Best regards,
    Markus
    (We are on BW3.1)

    Hi,
    we have the same problem. Does anybody have any hint or workaround? Is there a solution for this in 3.5 or any upcoming version.
    Any input is appreciated.
    Thanks,
    Stefan

  • Universal Worklist menu does not appear

    Hi All
    I still have same problem. We are on SP14, EP6. My id is in admistrave group
    It looks strange, There is no Universal Worklist & Workflow menu under detail navigation bar.
    I don't see Universal worklist & workflow menu under the the following ..System Administration -> System Configuration
    I can  see the following in System admin-->System config ..system landscape, System landscape overview, keystore admin, UM config, service config, KNowlegement management(content management, collaboration, index admin)....strange ...Universal worklist & workflow menu missing.
    As suggested above, i also refreshed the UWL service via System Administration -> Support -> Portal Runtime.
    Click on Application Console under "Portal Anywhere" Admin Tools. Select com.sap.netweaver.bc.uwl and click on show. Refresh and restart the services.
    It looks like Knolwdge management component is installed as i see the the memnu for knowlege management. Under
    System Administration -> System Configuration ...There is Knowledge Management side menu where i can see Universal worklist ( THere are CM, Collaboration,Index admin, Portal app, WF also listed)
    But still Universal Worklist & Workflow menu does not appear.
    Any suggestions. Thanks again.

    HI,
       Add eu_role to the user. The home workset will be added to the user. Under home->work you will find the UWL iview.
    or
    You can find the UWL iview in Portal content -> content provided by SAP-> End user content -> Standard portal users -> iviews -> com.sap.coll.iviews

  • The navigation menu does not appear when published to folder and my 12 photos are not on the site either

    The navigation menu does not appear when published to a file.  My 12 photos are also absent as well, just as if they wernt added.
    I have tried rebuilding the site but the same problem appears.  Everything else seems perfect up to tha publidhed file.
    Has anyone had the same problem,
    John
    Message was edited by: BOURBAH

    Have you tried: Trouble installing iTunes or QuickTime for Windows or iTunes for Windows Vista or Windows 7: Troubleshooting ...

  • The navigation menu does not appear when published to folder and my 12 photos arenot on the site eitherr

    The navigation menu does not appear when published to a file.  My 12 photos are also absent as well, just as if they wernt added.
    I have tried rebuilding the site but the same problem appears.  Everything else seems perfect up to tha publidhed file.
    Has anyone had the same problem,
    John

    Have you tried: Trouble installing iTunes or QuickTime for Windows or iTunes for Windows Vista or Windows 7: Troubleshooting ...

  • Sometimes ESS menu does not appear

    Hi,
       Sometimes when the user logs into the ESS the ESS menu does not appear
    . This happens only sometimes and when we restart the ITS and ask the  
    user to log in again the menu appears.
    I looked at the access log of the ITS and found the following entry there : access with invalid random key.
    Any suggestions will be very helpful.
    Below are the technical details  :                                                              
       ESS is being launched through the ESS menu 'PZM3'.                   
       ITS 620 patch level 16, HR 470 patch level 45, Basis patch level 54.
    Hi, I know that it is a weird problem but any brain storming suggestion would be helpful.
    Message was edited by: kapil sharma

    Hi Kapil,
    - check access log of ITS if the request was received
    - check if other flowlogic services like i.e. systeminfo work
    - check with a HTTP sniffer what was send to the server/client
    - check the output of view source in browser
    - make sure that no network device (proxy,loadbalancer...)  leads to the random failure
    - check trace files of ITS
    Just some ideas.
    Regards,
    Klaus

  • Navigation Drop Down Menu Does Not Appear Correctly with Internet Explorer.

    Website was designed with Dreamweaver CS5 on a Mac. The navigation drop down menu does not appear correctly with Internet Explorer. When you mouse over a navigation option that has a drop-down menu, the drop-down portion appears on top of the first level. Hope someone can help me out.Thanks!
    http://www.catchaghosttoursofkansas.com

    Hi,
    and you should then iron out this minor inaccuracy, which I found in your source code, for example here:
    <div align="center"><a class="MenuBarItemSubmenu" href="hays.html">HAYS</a>
            <ul>
              <li><a href="hayswalkingtour.html">Walking Tour</a> </li>
              <li><a href="forthays.html">Fort Hays</a></li>
            </ul>
    All your "first" entries have to show a '#", like this:
          <div align="center"><a class="MenuBarItemSubmenu" href="#">HAYS</a>
            <ul>
              <li><a href="hayswalkingtour.html">Walking Tour</a> </li>
              <li><a href="forthays.html">Fort Hays</a></li>
            </ul>
          </div>
    after that you can link to the individual subgroups. See here e.g. (screenshots from my German DW):
    Hans-G.

  • It says I can drag Pages documents from iMac to iCloud. But nothing shows up. Using latest with all turned on. How do I get Pages up to iCloud? The little wheel like action menu does not appear.

    It says I can drag Pages documents from iMac to iCloud. But nothing shows up.
    Using latest with all turned on. How do I get Pages up to iCloud? The little wheel like action menu does not appear.

    yes is tehre another way
    the directions do not explain anything other than drag
    or use the little action wheel menu

  • HT1619 menu does not appear when pressing the menu bottom from the apple remote

    I got a apple remote but the menu does not appear on the computer when pressing the menu bottom!?

    Prior to Lion, it used to invoke the menu of the FrontRow application.  FrontRow is no longer available with Lion.  The menu button will work with apple TV. 
    Regards,
    Captfred

  • My main menu does not appear when I turn on my apple tv first generation.  How do I restore my main menu?

    My main menu does not appear when I turn on my apple TV first generation, how do I restore my main menu screen?

    When I turn on, it asks for language choice, then it asks for 1080i, then it asks for network choices.  I choose my network, then it asks for my network password.  I enter the password, then it say it does not connect to network, and if I hit menu on remote, it goes back to network selection.  I can not get to main menu to see my setting for the network, because there is no menu. 

  • HT202213 I own toshiba laptops. Both computers have the latest itunes software. However the 'show menu' does not appear on the screen?

    I own toshiba laptops. Both computers have the latest itunes software. However the 'show menu' does not appear on the screen?

    Thanks for the response diesel. I dont think I clarified my question very well. I'm trying to do home sharing between mine and my wifes computers. The intructions say:
    Log in as the same user on each computer.
    Ensure both are current version.
    Choose the correct list in sharing ie Music
    Then in the 'show menu' at the bottom of the screen, choose items not in my library.
    I do not have the show menu to select any songs.
    Any help appreciated.
    Cheers

Maybe you are looking for

  • How do i add an event to the calendar of my ipad?

    Just purchased a new IPAD, 1st time user.  How do i add an event to the calendar of my ipad?  i do not have a "+"  symbol.

  • Acrobat X displaying the wrong font

    I've been using Acrobat X for a few weeks. The other day it installed an update. Since then my documents aren't displaying the font used by the orginal Office 2010 documents. If I create the PDF from Office 2010 by selecting "save as Adobe PDF" from

  • IDVD selectively won't recognize .mp4 format - how to burn for dvd player?

    Hi - I'm trying to burn a .mp4 movie for my gf's family so they can watch it on their TV instead of my tiny comp. After trying DiskUtility and iTunes (both to no avail, DU wouldn't even allow me to select a .mp4 format to burn on the DVD; iTunes burn

  • Database design problem. Need Help?

    I have to display records in a table in a UI where users are allowed to move records to specify priority for the records. Here is an example, a db table has 4 records: RecordId Ranking A 1 B 2 C 3 D 4 Now if a user tries to set the Ranking of the rec

  • Rows to columns function

    Hi! In our application we have a table that stores service classes, fare types and flight fares etc. I.e. ID From To Service_class fare_type fare 1 VIE FRA Economy Economy Basic 119,03 1 VIE FRA Economy Economy Flex 483,25 1 VIE FRA Business Business