Pb with pop up menu on right click

I have this bit of code in my application
void jTreeDisk_popupMenu(MouseEvent e)
          if(e.isPopupTrigger() == false ||
                    selectedFile == null)
               return;
          if(!selectedFile.isDirectory())
               System.out.println("selected not directory " + selectedFile.getName());
               //For a selected file all the menu items are visible
               //Check the availability of the menu item
               fileExplorerPopupMenu.removeAll();
               fileExplorerPopupMenu.add(jMenuItemOpen);
               fileExplorerPopupMenu.add(jMenuItemPrint);
               fileExplorerPopupMenu.add(jMenuItemMail);
               if(Desktop.isPrintable(selectedFile))
                    jMenuItemPrint.setEnabled(true);
               else
                    jMenuItemPrint.setEnabled(false);
               fileExplorerPopupMenu.show((Component)jTreeDisk, e.getX(), e.getY());
          else
               //For a selected directory, only "Open".
               //Window items are visible
               System.out.println("selectedFile directory " + selectedFile.getName());
               fileExplorerPopupMenu.removeAll();
               fileExplorerPopupMenu.add(jMenuItemOpen);
               fileExplorerPopupMenu.show((Component)jTreeDisk, e.getX(), e.getY());
     }When i run my program within the IDE(eclipse) the popmenu appear, but when i deploy my application and run it, the popupmenu doesn't appear. In fact e.isPopupTrigger always return false, i don't know why.
My system is windows xp.
Can someone expain me why this happen and how to solve this.
Thanks a lot.

Hi David,
What mouse event in the method jTreeDisk_popupMenu in which isPopupTrigger() is called - mousePressed, mouseReleased ?
Also note that "Popup menus are triggered differently on different systems"
Would you like to try calling the method in deferent mouse events to see if, when it returns true?

Similar Messages

  • Pop up menu on right clicking an image?

    Hello,
    I am new to LabWindows/CVI. 
    Requirement: "To get a pop-up menu on right clicking on image"
    Right now, I display my images in window numbers (0 - 15). Is it possible to be able to get a pop-up menu on right clicking an image window. If yes, how? If not, could you please suggest other methods to achieve this task? Should I display the image in a separate parent panel for example? How could I do this?
    Any help would be great.
    Cheers

    I would use the code generator for right click event. then fill it up with whatever code you want under right click case. You can access these when you double click your UIR file, then on the top of the page click Code\Preferences\Default... then choose desired events for picture then go to Code\Generate\all callbacks and skip through the ones you don't want to be replaced.

  • How to get a pop-up menu on right click of JTree?

    hi
    My application consists of a JTree.I am having a 2 root nodes each one have some child nodes.in the first root node what i want is on right click of child node i have to display one option that is enabled and on the second root node what i want is on right click of child node i have to display one option that is disabled..
    how to do that
    thanks for your reply in advance,

    When you are creating your nodes, do node.setUserObject(objectName);
    and on right click, do something like this
    if (e.isPopupTrigger() == true) {
             selPath = tree.getPathForLocation(e.getX(), e.getY());
          try {
             // If Right Click, Select the Node
             Object[] selectedPath = selPath.getPath();
             DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) selectedPath[selectedPath.length - 1];
             try {
                dataObject = (MyObject) selectedNode.getUserObject(); // Set the Data Object
             } catch (ClassCastException ex) {
                                      ex.printStackTrace();
             // Check for the right click on Framework Node
             if (dataObject.getClass().isInstance(new MyObject()) == true) {
                // Disable the pop-up menu
    ....

  • How do I change the pop up menu for right click to Tools?

    Hi,
    I generally know my way around Photoshop but for some reason this has me stumped.
    When I right click on the image I'm working in (using my Cintique pen button) I get the Brushes panel as a pop up.
    Very handy, but I hate Brushes- I much prefer Tools (even if most of my Tools are modified Brushes).
    How do I change this pop up so it shows the Tools?
    I've looked in both the PS prefs and the Cintique settings.
    Think I'm just not doing it right.
    Please help if you know how to make this change.
    Thanks,
    Tom B
    I'm in Mac OS 10.5.8 running PS CS3

    Thanks Trevor, been trying various options along those lines.
    @c.pfaffenbichler
    Yes, I'd like to raise the Tool Presets panel by Right Clicking using the Cintique pen.
    In just the same way as I currently do to access the Brushes panel.
    "Then what did you mean by »even if most of my Tools are modified Brushes«?"
    As above- "A Tool may be a Brush (or an Eraser, or a Cloner, etc) though not all Brushes, etc, are Tools."
    Just as one might say "all swans are birds, though not all birds are swans."

  • Firefox hangs and will not allow me to access other programs running when I resize a pop up window, move a pop up window, accidentally right click flash content.

    Firefox hangs and will not allow me to access other programs running when I resize a pop up window, move a pop up window, accidentally right click flash content.
    == This happened ==
    A few times a week
    == Not sure when it statrted

    Hi.
    When this happens, please press CTRL+SHIFT+ESC and see how much RAM and CPU Firefox is using. If they're sky high, then... Well, that kind of issues are, unfortunately, more common and the we'd like. Thankfully, 99% of the cases are very easy to solve. However, you do need to diagnose what your exact problem is. Do this:
    #run Firefox in safe-mode to disable all extensions and plugins. If this fixes your issues, be them with RAM or CPU usage, then you know it's a problem with plugins or extensions. Proceed to number 2. If safe-mode doesn't fix the issues, then read bellow, after this list;
    #update all extensions and plugins in your Firefox. If this doesn't solve the issues, proceed to the following number;
    #disable all extensions and plugins in your Firefox (not running safe-mode). Being certain that, as in safe-mode, the problems you're having have gone away, enable one plugin at a time. You should be certain that you WANT that plugin to be enabled, so keep your overall number of plugins as low as possible. When you encounter the problems, you know you've found a problematic plugin, so disable it for good. Keep enabling all plugins (except problematic ones) until you've gone through them all.
    #enable one extension at a time. Again, be certain that you WANT that extension to be enabled, so keep your overall number of extensions as low as possible. When you encounter the problems, you know you've found a problematic extension, so disable it for good. Keep enabling all your extensions (except problematic ones) until you've gone through them all;
    #you're done! You've fixed your problems with problematic add-ons.
    Ok, if disabling all extensions and plugins through safe-mode didn't work to bring Firefox's CPU and RAM usage to good levels, then you have different issue. The most likely scenario is that you have a third party software running on your computer that is messing with Firefox. Do as follows:
    #do a virus/malware check on your computer. If this doesn't fix it, proceed;
    #disable all software running in the background that you don't want to have running in the background (in windows, this is done by pressing WINDOWS+R in your keyboard, typing "msconfig" (without the commas) and pressing enter. Now, under the "Startup" tab, you can uncheck the software you don't want, and reboot your system for changes to take effect. If you're unsure of what software you want running, ask someone with more experience). If this doesn't fix you issues with Firefox, proceed;
    #check your firewall/antivirus/security suite for enabled functions/features that you don't want and/or may be conflicting with Firefox. You'll find that these features are most likely tied to Internet Security features, such as link scanners or URL checkers and the like. If you're not sure they are conflicting with Firefox, simply try to disable to see whether or not that's true. As long as you don't browse the web with your antivirus completely off and your firewall completely turned off, there should be no problems. If this doesn't solve the issues, proceed to the following number;
    #check your operating system security options, mainly advanced options that are not configured by default. While it's very unlikely that this may be the cause of the problem (after all, it's the last item on the list), it's remotely possible. If this doesn't do it, I'm out of ideas. Except make sure you've followed my instructions correctly.

  • Playing dvds with vlc ... no right-click and 'open with vlc' option???

    i searched discussions for this question but wasn't sucessful ... so here's my question:
    i use a toshiba pc laptop and an iMac G5 ... in order to watch dvds (with different region codes) on my PC, I use VLC with great success ... I wanted to do the same on my iMac, but came across the following problem:
    when I want to watch a DVD on the laptop, i simply right-click the title and go for 'open with VLC' (which gives me the menu and so on) ... when I try to do this on the iMac, however, there is no
    'open with VLC' option when I right-click the DVD ... I can open single chapters of the DVD by opening the single .vob files, but I'm not happy with doing that ...
    any ideas how to make watching DVDs with VLC on my iMac as easy as it is on my laptop?
    thanx for your help!
    2.1 GHz iMac G5 1.5 GB DDR2 SDRAM   Mac OS X (10.4.6)  

    found the solution by myself: open vlc, open the playlist and drag the dvd onto the playlist, then hit play ...

  • Menu on right-click for numeric control

    Hello,
    is there a way to program a "menu on right-click" for a control (e.g. numeric), like there is for table controls?
    I'm working with CVI 8.0.1 
    Thanks & Best Regards,
    Greg

    Yes, every control can be added a popup menu with a few instructions.
    Design the menu nar in the UIR editor; do not associate it to any panel
    Load the menu bar when needed with the line menuHandle = LoadMenuBar (0, "myfile.uir", menuBar): by passing 0 as the panel handle it will not be associated to any of them
    In the numeric callback add these instructions:
         switch (event) {
            case EVENT_RIGHT_CLICK:
                // Context menu
               choice = RunPopupMenu (menuHandle, menuBar_Menu, panel, eventData1, eventData2, 0, 0, 0, 0);
                switch (choice) {
                     case menuBar_menu_item1:
                              // menu item handling code
                              break;
                break;
    Passing eventData parameters to RunPopupMenu function ensures that the menu is displayed at the mouse position.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Displaying a context menu on right click on rich tree

    Please see the code below. I want to display a context menu on right click on a rich tree.
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:rich="http://richfaces.org/rich">
        <style>
            .col1{ width:50%; vertical-align:top;
        </style>
        <h:form>   
            <h:panelGrid columns="1" width="100%" columnClasses="col1">
                 <rich:tree style="width:300px" nodeSelectListener="#{simpleTreeBean.processSelection}"
                    switchType="client"
                    value="#{simpleTreeBean.treeNode}" var="item" id="item">
                    <rich:componentControl event="onClick" for="menu" operation="show">
                    <f:param value="#{item.data}" name="send" />
                </rich:componentControl>
                </rich:tree>
                </h:panelGrid>
            <a4j:outputPanel ajaxRendered="true">
                <rich:panel>
                    <f:facet name="header">Last Menu Action</f:facet>
                    <h:outputText escape="false" value="Right Click :  #{simpleTreeBean.nodeTitle}" id="selectedNode" />
                    <br/>
                </rich:panel>      
            </a4j:outputPanel>
                 <rich:contextMenu event="oncontextmenu" actionListener="#{SimpleTreeBean.processCurrElement}" attached="true" id="menu" submitMode="ajax">
                <rich:menuItem ajaxSingle="true">
                <b> #{simpleTreeBean.nodeTitle}</b> Send To
                    <a4j:actionparam name="det" assignTo="#{ddmenu.current}" value=" #{simpleTreeBean.nodeTitle}"/>
                </rich:menuItem>
            </rich:contextMenu>
        </h:form>
    </ui:composition> With this code, i need left click at first then right click, then it will show the selected node. I want to get the value of the node title on right click. Please help me with it. The SimpleTreeBean code:
    package com.dW;
    import java.awt.event.ActionEvent;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Properties;
    import javax.faces.FacesException;
    import javax.faces.context.ExternalContext;
    import javax.faces.context.FacesContext;
    import org.richfaces.component.UITree;
    import org.richfaces.event.NodeSelectedEvent;
    import org.richfaces.model.TreeNode;
    import org.richfaces.model.TreeNodeImpl;
    public class SimpleTreeBean
        private TreeNode rootNode = null;
        private String nodeTitle;
        private static final String DATA_PATH = "images/simpleTreeData.properties";
        private void addNodes(String path, TreeNode node, Properties properties) {
            boolean end = false;
            int counter = 1;
            while (!end) {
                String key = path != null ? path + '.' + counter : String.valueOf(counter);
                String value = properties.getProperty(key);
                if (value != null) {
                    TreeNodeImpl nodeImpl = new TreeNodeImpl();
                    nodeImpl.setData(value);
                    node.addChild(new Integer(counter), nodeImpl);
                    addNodes(key, nodeImpl, properties);
                    counter++;
                } else {
                    end = true; } }  }
        private void loadTree() {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExternalContext externalContext = facesContext.getExternalContext();
            InputStream dataStream = externalContext.getResourceAsStream(DATA_PATH);
            try {
                Properties properties = new Properties();
                properties.load(dataStream);
                rootNode = new TreeNodeImpl();
                addNodes(null, rootNode, properties);
            } catch (IOException e) {
                throw new FacesException(e.getMessage(), e);
            } finally {
                if (dataStream != null) {
                    try {
                        dataStream.close();
                    } catch (IOException e) {
                        externalContext.log(e.getMessage(), e);
        public TreeNode getTreeNode() {
            if (rootNode == null) {
                loadTree();
            return rootNode;
        public void processSelection(NodeSelectedEvent event) {
            UITree tree = (UITree) event.getComponent();
            nodeTitle = (String) tree.getRowData();
        public void processCurrElement(ActionEvent event) {
            UITree tree = (UITree)event.getSource();
            nodeTitle = (String)tree.getRowData();
            System.out.println(nodeTitle);
        public String getNodeTitle() {
            return nodeTitle;
        public void setNodeTitle(String nodeTitle) {
            this.nodeTitle = nodeTitle;
    }

    Hi,
    Do you have a solution for this? Looking for exactly the same.
    As far as I have it at the moment I have the backing object added to the attributes of the node:
    <a4j:support event="oncontextmenu"
                                         oncomplete="#{rich:component('foldersContextMenu')}.doShow(event, {})"
                                         actionListener="#{customerBean.buildContextMenu}" reRender="foldersContextMenu, selectedNode">
                                <f:setPropertyActionListener value="#{item}" target="#{customerBean.nodeTitle}"/>
                                <f:attribute name="node" value="#{item}"/>
                            </a4j:support>This allows me to get the object in the backing bean:
    public void buildContextMenu(ActionEvent event) {
            UIComponent component = event.getComponent();
            log.info("component: " + component.getId());
            Category node = (Category) component.getAttributes().get("node");
            log.debug("node : " + node);But how I translate that to setting this as the current node is causing me problems.
    Thanks
    Jon

  • JSF Popup Menu on right click

    Hi ,
    I want to popup menu on right click of any component(say tree).I searched on the net and found the tomahawk <t:popup> component.
    This component popup the menu when mouse pointer enter in to the component but I don't want this behavior.
    I want to popup the menu only when I right click on the component.
    This is sample program
    <t:popup id="a"
    styleClass="popup"
    closePopupOnExitingElement="true"
    closePopupOnExitingPopup="true"
    displayAtDistanceX="10"
    displayAtDistanceY="10" >
    <h:outputText id="oa" value="#{country.name}"/>
    <f:facet name="popup">
    <h:panelGroup>
    <h:panelGrid columns="1" >
    <h:outputText value="#{country.cities}"/>
    </h:panelGrid>
    </h:panelGroup>
    </f:facet>
    </t:popup>
    DO you have any component like this ? Or any other way to do like this ?
    Thanks in Advance,
    KK

    I wrote a component a while back that does something similar to what you want. You'd probably need to fix it up and add any features that you need that it doesn't already have. It pops up a menu on a right-click, it allows you to provide a facet to supply the contents of the menu. I doubt I made sure it works in IE or any browser other than Firefox... so there may be JS issues. It has some other component dependencies you might want to remove also. I could get it to the point where you could try it out and fix it up if you want, but I won't have time until next week.
    Ken Paulsen
    https://jsftemplating.dev.java.net

  • When i use view as list in finder and open a folder with many files i cant right click with mouse without selecting or highlighting a file....i just want to right click to paste an item or create a new folder...what can i do?

    When i use view as list in finder and open a folder with many files i cant right click with mouse without selecting or highlighting a file....i just want to right click to paste an item or create a new folder...what can i do?

    Thx for that im gonna try it....but is there a way to do it without using toolbar or cmd-c...? i mean using only the mouse?why does it have to highlight the file even though i click a bit next to it....?using icon view i can right click next to the folder and i wont have a problem but with list view that i prefer using it will highlight the whole row.....and i dont find free space to right click cause i got many files

  • My magic mouse behaves erratically with intermittent problems - slows down, right click doesn't work, disconnects for a few seconds then reconnects. Anyone suggest what I could do to fix this?

    My magic mouse behaves erratically with intermittent problems - slows down, right click doesn't work, disconnects for a few seconds then reconnects. Anyone suggest what I could do to fix this?

    I just figured out the print quality issue for my wife with her new iMac and new printer.
    She replaced both at once and she couldn't understand why her Artisan 730 was lower quality then her Epson R280 when they had the same specs.
    Turns out the newer printer had the option to connect via wifi which we used during setup.
    The driver options are completely different depending on how you connect.
    Once I connected via USB the correct options were available and the print quality was better.
    Looking at the R2400 it dies not have wifi, but while researching the problem for my wife someone esle was having an issue updating to the latest printer driver.
    If you go into the print utility from the Printer and Scanner system preference and under the general tab you should have driver 5.5.
    One user had to delete the old printer driver before Software Update loaded the newer printer driver.
    https://discussions.apple.com/message/15947486#15947486
    On my MacBook Pro (w Snow Leopard) I always had to reconnect my wifi at home when it woke up. I upgraded my router from an old Netgear to a newer N D-Link and stopped having to do that.
    I would be surprised you would have that problem with an Airport Extreme, you might check to see if there is a firmware update for it.

  • "Open with" pop-up menu application list editing

    I have installed Adobe Photoshop CS2 on my iBook G4. When opening .jpg or other file with "Open with" pop-up menu there is alot of applications which gives only a long list for me. How to edit this list.

    hi vienspatsmajas,
    You can try using Zingg! to configure the "open with" menu
    http://www.versiontracker.com/dyn/moreinfo/macosx/12965&vid=130824
    Lori

  • "Toast it" appearing in menu when right clicking

    The words "Toast it" appears in menu when right clicking an icon but Toast has been uninstalled. How can I remove it please?

    Try this previous discussion:
    https://discussions.apple.com/message/12533120#12533120
    Re: "Toast It" wont go from contextual menu

  • Popup menu when right clicking DataGrid column

    I have a DataGrid and I'd like the user to be able to
    right-click on the header and pick from some options in a menu.
    Such as give them the ability to clear the rows in the grid. I saw
    on Flex Examples you can add an option to the normal Flash menu
    that pops up but thats not what I want. I want an actual Flex popup
    to appear with my options in there. I saw this done somewhere once,
    but can't find it now.
    This would replace the need for a button below the table,
    which I think will look nicer.
    Any ideas?

    Hi Miklos, you will have to hang your option in the GoTo Menu (id 5888) while creating your From. This menu is Form dependent, therefore when you open another form it will be reseted. After this you will see your option with the right mouse click.
    Catch the MenuEvent and bind it to the class you already use to bring your "Analysis Report" to the front.
    Check also object Form.Menu for further info.
    oMenuitem = B1_Application.Menus.Item("5888")
    MenuParam.Type = SAPbouiCOM.BoMenuType.mt_STRING
    MenuParam.UniqueID = "REPTMNU"
    MenuParam.String = "Analysis Report"
    MenuParam.Enabled = True
    oMenus = oMenuitem.SubMenus
    oMenus.AddEx(MenuParam)
    It's also possible to add it in your Xml Form file as follows:
    - <FormMenu>
    - <Menus>
    - <action type="add">
      <Menu Checked="0" Enabled="1" FatherUID="5888" Image="" Position="0" String="Analysis Report" Type="1" UniqueID="REPTMNU" />
      </action>
      </Menus>
      </FormMenu>
    Regards,
    Felipe

  • Rollovers with Pop up Menu

    The last time I tried to do rollovers with a pop up menu in
    Dreamweaver 8. It wouldn't work. So I'm searching for another way
    to do it.
    I created navigation using Fireworks - follow link below to
    example. But when I mouse over the rollover that has a pop up menu
    attached to it (First link on the left) the rollover images
    disappear. Also the drop down menu tends to hang down longer than I
    would like.
    Can my problems be fixed? Is Fireworks the right tool for
    this task?
    I had down loaded a trial of the latest version of
    Dreamweaver a few months ago and it seemed that this feature had
    been deprecated, but there was some sort of plug-in. I'm far from a
    casual user, but it was beyond me for the weekend I tried to use
    it. Also, this is a bad time for me to invest in new software or
    upgrades.
    Any assistance would be greatly appreciated.
    Example of rollover and
    pop up menu problem

    Don't use Fireworks to make HTML,
    especially interactive HTML. Fireworks is a great tool for
    making Web graphics, but it is
    NOT
    good for making HTML. Don't go there. You won't be happy.
    Read this:
    The
    Sordid Tale of mm_menu and fw_menu.js and then save yourself
    loads of frustration and go buy yourself a professional menu.
    What's your billing rate? At $20/hr a $100 professional menu that
    works, cross-browser, beautifully, is going to save you more
    than 5 hours of hassle trying to get this stuff in Fireworks to
    halfway...kinda...function...almost.
    I don't use these kind of menus, but I've seen this question
    asked often enough to know that one recommendation is the code from
    Project
    7.

Maybe you are looking for

  • Problem with Language translation

    Hi All,      Our project has gone under EHP Upgrade last week,      But the customer is facing problem with XD03 transaction.      The problem is, even after logging in Finish the following fields are displayed in English.... Customer chain Agreem. g

  • How to clear "other" storage space

    How do you clear storage space taken up by "other"?

  • Install solaris 10 to UCS from network server

    Can anyone share your experience on doing this?

  • Database instance for XI

    Why does XI need separate database instance. Can I use a existing database to write its schema and data and just make oracle client from XI host to talk to the oracle database. Because I don't need another database to make the XI box bigger. I want t

  • OWB 9.0.4.8.21

    I am doing a simple mapping from a flat file to table(straingt 1 to 1, no transformations or checks). It gets validated , generated and deployed successfully, but while executing it it give me this error Starting Execution MAP1 Starting Task MAP1 RPE