Right - click override

Hi all!
I want to do a "Win XP simulation" with flash and
Actionscript but I have a problem...the context menu....I want to
override it with a custom menu that resemble that of windows but
the right click is catch from the flash player. Is there a way to
bypass the menu or to make a completely new one?
Thanks!
Walker Boh

This might help you along your quest:
http://www.emanueleferonato.com/2009/03/11/understanding-as3-context-menus/

Similar Messages

  • Lately when I try to right click it opens a new tab with recent searchs.I have to go back to the tab and right click again to get the options. How do i fix it?

    When I try to right click now instead of getting the menu it goes into a new tab showing recent searches.I have to go back and right click again to get the menu and do what I wanted in the first place.Is there a way to fix this.This is really irritating.I like firefox but I'm ready to go back to Chrome. Thanks for any help.

    You're right-clicking a link? I can't think of any setting that opens a blank tab when you right-click in a page. It's also strange that it would occur on the first click but not on the second click.
    Does this affect all sites?
    Are you expecting Firefox's context menu or the site's context menu?
    One thing that comes to mind is overriding the site's own right-click handler by disabling scripts from capturing the right click. This is set under
    orange Firefox button (or Tools menu) > Options > Content
    To the right of "Enable JavaScript" is a button to access "Advanced" options. If it's checked, uncheck the box for "Disable or replace context menus".

  • Select multiple nodes in a JTree a right click

    Hi all,
    I've a JTree and I'd like to allow the user select some nodes (one or more) right click and than show a popupMenu.
    This behavior seems not to be easy, because if I select a single node (right clicking on it) the node does not appear selected ; I need to select it left clicking and than everything works fine.
    I read some posts found in the forum and the solution seems to be :
    - attach a mouseListener to the JTree
    - get the TreePath of the node selected
    - force the selection on the node with setSelectionPath(TreePath)
    This works fine if you need to select only one node, cause if you have to select more, you simply cannot.
    I wonder a so obvious behavior is so hard to achieve.
    I hope somebody out there had made the magic.
    Any help would be appreciated.
    Flavio Palumbo

    Hi Darryl,
    I wrote the test case below.
    Using the methods you suggested it works almost fine.
    The only behavior not desired is when you select a range (shift or control), release the key an than right click ; in this case remains selected the only node you clicked on ; to select the range clicking with the right button, you have to keep pressed the key.
    Any hint would be appreciated.
    Flavio
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.swing.JFrame;
    import javax.swing.JMenuItem;
    import javax.swing.JPopupMenu;
    import javax.swing.JTree;
    import javax.swing.SwingUtilities;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreePath;
    public class TestTree {
        JTree jtr = null;
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new TestTree();
        public TestTree() {
            JFrame jf = new JFrame();
            jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            try {
                javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
                javax.swing.SwingUtilities.updateComponentTreeUI(jf);
            } catch (Throwable e) {
            jf.setPreferredSize(new java.awt.Dimension(200, 560));
            javax.swing.JScrollPane js = new javax.swing.JScrollPane();
            DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
            jtr = new JTree(root);
            jtr.addMouseListener(new TestTreeML());
            js.setViewportView(jtr);
            jf.getContentPane().add(js);
            for (int i = 0; i < 20; i++) {
                DefaultMutableTreeNode nodoFiglio = new DefaultMutableTreeNode("nodo" + i);
                ((DefaultTreeModel) jtr.getModel()).insertNodeInto(nodoFiglio, root, root.getChildCount());
            jf.pack();
            jf.setVisible(true);
        public class TestTreeML extends MouseAdapter {
            @Override
            public void mousePressed(MouseEvent e) {
            @Override
            public void mouseClicked(MouseEvent e) {
                try {
                    if (!e.getSource().equals(jtr)) {
                        return;
                    TreePath tpSel = jtr.getPathForLocation(e.getX(), e.getY());
                    if (tpSel == null) {
                        return;
                    int i = 0;
                    final DefaultMutableTreeNode node = (DefaultMutableTreeNode) tpSel.getLastPathComponent();
                    TreePath[] tpExisting = null;
                    if (e.isControlDown() || e.isShiftDown()) {
                        System.out.println("control/shift");
                        TreePath[] tpEx = jtr.getSelectionPaths();
                        tpExisting = java.util.Arrays.copyOfRange(tpEx, 0, tpEx.length + 1);
                        i = tpEx.length;
                    } else {
                        tpExisting = new TreePath[1];
                    tpExisting[i] = tpSel;
                    jtr.setSelectionPaths(tpExisting);
                    if (e.getClickCount() == 2) {
                        System.out.println("double click on " + node.getUserObject());
                    if (javax.swing.SwingUtilities.isRightMouseButton(e)) {
                        if (!e.isControlDown()) {
                            jtr.setSelectionPath(tpSel);
                        JPopupMenu menu = new JPopupMenu();
                        JMenuItem it0 = new JMenuItem("Option1");
                        it0.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                System.out.println("Option1 on " + node.getUserObject());
                        menu.add(it0);
                        JMenuItem it1 = new JMenuItem("Option2");
                        it1.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                System.out.println("Option2 on " + node.getUserObject());
                        menu.add(it1);
                        menu.show(jtr, e.getX(), e.getY());
                } catch (Throwable t) {
    }

  • Razer DeathAdder right click, scroll wheel disabled

    I bought a Razer DeathAdder Black Edition around a week ago. It comes with Mac drivers which I installed, however I installed ControllerMate and SteerMouse as well, in order to remap buttons and fix the acceleration and polling issues with high-res mice in OS X. Everything was working correctly until yesterday, when I enabled the included DeathAdder controller in ControllerMate.
    Now right-clicking is disabled, and the scroll wheel does not function the way it used to. Whereas once the scroll wheel controlled the scroll bar, now it also scrolls and selects content within any Finder or browser window; the only way I can scroll up or down is to place the cursor over the scroll bar while I scroll. I have tried unplugging the mouse, restarting, and uninstalling the Razer drivers, ControllerMate and SteerMouse, to no avail. When I reinstall the Razer drivers and try to program the mouse buttons, the changes I make have no effect. It's as though something is overriding the drivers. The problem is, can't figure out what's doing it.

    I don't know if this will work, but try uninstalling everything, then manually go into Library folder to see if anything is left behind.  Delete anything you see related to Razer, Controller Mate, and Steermouse.
    Library->Application Support
    Library->Preferences  For example, ControllerMate has a "com.orderedbytes.ControllerMate.plist" file.
    Library->PreferencePanes
    Library->LaunchAgents For example, delete ControllerMateHelper if it's there.

  • Two finger right click on g4 ibook

    Hi guys,
    I just got an ibook g4 and was wondering if there is such an option or program I can download in order to be able to right click using two fingers on the scroll pad like the MB and MBP.

    Sidetrack will allow the right click, however, I believe you lose your ability to two-finger scroll.
    The FAQ states:
    Q: Does SideTrack support two-finger scrolling on MacBooks and late-model PowerBooks and iBooks (2005 and later)?
    A: Two-finger scrolling is a feature of the Apple driver for the USB trackpad hardware found in Apple laptops manufactured after 2005. Installing SideTrack will override the Apple driver and switch the trackpad to SideTrack's features. Support for two-finger scrolling on USB trackpads is being investigated and may appear in a future SideTrack release.
    So you lose 2 finger scrolling but SideTrack allows you to scroll single finger.

  • I open facebook or other site. right click link/photo to open in new tab quickly. Then all tab connection will be connection to website, all page stop loading. Have to close firefox and reopen then only site will load.

    I open facebook or other site. right click link/photo to open in new tab quickly. Then all tab connection will be connection to website, all page stop loading. Have to close firefox and reopen then only site will load.

    You can override how links are opened via the browser.link.open_newwindow.override pref.
    *http://kb.mozillazine.org/browser.link.open_newwindow
    *1: current tab; 2:new window; 3:new tab;
    Use this for links opened via JavaScript.
    *http://kb.mozillazine.org/browser.link.open_newwindow.restriction
    See also:
    *http://kb.mozillazine.org/Prevent_websites_from_disabling_new_window_features

  • Right click on script"run with PowerShell"

    I have set the execution policy in GPO to remoteSigned, and it is working fine, when I run the script from cmd prompt powershell –f
    When I right click the script and choose “run with PowerShell” it starts with this text in red
    Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. 
    Due to the override, your shell will retain its current effective executionpolicy of RemoteSigned
    The script is working, but it do not look right for a user of the script.
    Sometimes when I run the script “run with PowerShell” it prompts the user to overwrite policy, again no matter if I choose yes or no, the script will run.
    I am running on Windows 8.1 Update 1 x64, Powershell 4.0
    Do anyone know how to fix?
    Kind Regards
    Jens
    Jens Lund

    There is another Group Policy setting that is setting a different policy. Post in the GP forum to get help with fixing this.
    Possibility #2.  You are setting the policy in your profile or on the command line.
    ¯\_(ツ)_/¯

  • Right click event on a matrix

    Hi All
    I have to capture the right click event on a matrix
    here is my code
    <B1Listener(BoEventTypes.et_RIGHT_CLICK, True)> _
            Public Overridable Function OnBeforeRightClick(ByVal pVal As ContextMenuInfo) As Boolean
                Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
                'ADD YOUR ACTION CODE HERE ...
                If pVal.ItemUID = "matItems" Then
                    ' do something
                End If
                Return True
            End Function
    the problem is that pVal.ItemUID always return null.
    Can any one help me
    Regards
    Arun TB
    Edited by: aruntb on Jul 14, 2010 9:39 PM

    Solved

  • Right-click on a VI with missing dependencies hangs LabVIEW

    Here's the flow:
    1)  Download a VI from the forums that has a missing dependency
    2)  Add the VI to a project
    3)  Right-click on the VI to see if it's set to run-on-open
    4)  Wait a very long time for the dependency load to fail
    How do you all handle the forum VIs? Is it as simple as checking the Files view for missing deps - and only RMB if none are missing?
    I can't find any of the "silently ignore all" posts/ideas except for opening refs.
    When I create new VIs and force a dependency failure, there is not a long delay.

    How do you tell if the VI is set to Run When Opened?  If you are opening the properties dialog, the VI still has to load.
    ***Just performed an experiment***
    Opening the VI from the project overrides the Run When Opened.  Good thing to know.
    But still, when you try to open a VI and there are missing dependencies, you get a dialog that has the Ignore All on it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Loading Window.PNG ‏23 KB

  • Layer selection vis right-click in CS5

    i'm not sure if this is happening to anyone else, but in CS4 when i right-click (control-click) on my canvas the contextual layer menu that popped up automatically selected the "top" most layer that appeared under my cursor. in CS5 it just throws up a list of all the layers under the cursor. it's a major pain and a huge step backwards in my workflow. as much as i'm enjoying the slightly more solid and snappy feel of a cocoa app and content aware fill, i use the right-click layer selection hundreds of times a day. as minor a feature as it is, it's a show stopper for me.
    i'm hoping this is one of those "standardizing on os x behaviors" and there's a simple toggle where i can switch it back to the CS4< behavior, but so far i haven't found it.
    CS4 behavior:
    CS5 behavior:
    added screenshots to illustrate the point

    thank you dmcalester i was about to do the exact same thing. i don't think chris was understanding the problem. yes sliding the mouse over a few pixels will put the cursor on the menu list of layers but the functionality that we are ALL wanting back is that CS4 would actually put the correct layer under your cursor in the menu list when you right clicked. CS5, using cocoa's default menu, is just giving us a list of the layers (granted a correct list) but not putting the layer we want under or near the cursor. This is why we are frustrated because it is lacking previous functionality. Please fix this as soon as possible.
    In the image below you can see that the layer I am trying to select is the 'Bid Button Bar'. Notice that in CS4 the menu has shifted up slightly to put the correct layer under my cursor. This functionality is missing in CS5.
    also if you have to go in and override the default OS behavior anyway, now maybe a good time to improve upon the right click listing like phase2design hinted at. i know its just a list but things like making folder stand out from layers and maybe even the thumbnail like pixelmator. i'm all for those kinds of improvements.
    but even if you (the adobe team) disregard all of that, bottom line: just bring back the previous functionality of right click in the next update. i appreciate you listening to all our feedback and thank you for all your hard work to provide us with the best user experience possible

  • Stopping right click selecting tab in JTabbedPane

    Hello all,
    This may be a really simple thing + I'm probably being thick, but is there a way to prevent a right click changing the selected tab on a JTabbedPane.
    I tried consuming the MouseEvent, but that didn't seem to work. Couldn't find an answer anywhere else in the forums & couldn't see anything in the JavaDoc that looked as if it would help.
    Answers on a postcard please......
    RT

    You might be able to extend JTabbedPane and override setSelectedIndex().
    I had to do this to work around a focus issue I had.
      This class extends JTabbedPane to correct a problem where it doesn't
      request focus when clicked on.
    import java.awt.*;
    import javax.swing.*;
    public class MyJTabbedPane extends JTabbedPane {
      public void setSelectedIndex(int index) {
        Component comp = KeyboardFocusManager.
            getCurrentKeyboardFocusManager().getFocusOwner();
        //  if  no tabs are selected
        // -OR- the current focus owner is me
        // -OR- I request focus from another component and get it
        // then proceed with the tab switch
        boolean noTabSelected = getSelectedIndex()==-1;
        boolean hasFocus = requestFocus(false);
        boolean compIsMe = comp==this;
        if(noTabSelected || hasFocus || compIsMe) {
          super.setSelectedIndex(index);
    }

  • Create a PopupMenu when right click onto an item of JComboBox

    How do I make so that, a popupmenu appear only when I right click onto a item of JComboBox. What I have right now is showing a PopupMenu whenever I right click on the frame.
    I got another question to ask if you guys dont mind. How do I set the ComboBox to scroll horizontally. Right now I set the preferredSize of the ComboBox so if the item's names are too long, it will be cut off. Can I set it so that I can scroll horizontally to see the rest of the item's name?

    My English is very poor, so it's hard to explain...
    3.
    // This is just an example code and has not been tested.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.plaf.basic.*;
    public class ComboRightClickTest{
      public JComponent makeUI(final JFrame frame) {
        frame.setGlassPane(new LockingGlassPane());
        String[] items = {"test1", "test2", "test3"};
        JComboBox combo = new JComboBox(items);
        combo.setUI(new BasicComboBoxUI() {
          protected ComboPopup createPopup() {
            return new BasicComboPopup( comboBox ) {
              protected JList createList() {
                return new JList( comboBox.getModel() ) {
                  public void processMouseEvent(MouseEvent e)  {
                    if(e.isPopupTrigger()) {
                      String s = getSelectedValue().toString();
                      frame.getGlassPane().setVisible(true);
                      final JPopupMenu m = new JPopupMenu();
                      final JMenuItem i = new JMenuItem(
                          new AbstractAction("del:"+s) {
                        public void actionPerformed(ActionEvent ae) {
                          comboBox.removeItemAt(getSelectedIndex());
                          frame.getGlassPane().setVisible(false);
                          m.setVisible(false);
                      i.addMouseListener(new MouseAdapter() {
                        public void mouseEntered(MouseEvent me) {
                          i.setBackground(getSelectionBackground());
                        public void mouseExited(MouseEvent me) {
                          i.setBackground(getBackground());
                      m.add(i);
                      Point p = e.getPoint();
                      SwingUtilities.convertPointToScreen(p, this);
                      m.show(null, p.x, p.y);
                      return;
                    super.processMouseEvent(e);
        JPanel p = new JPanel(new BorderLayout());
        p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        p.add(combo, BorderLayout.NORTH);
        p.setPreferredSize(new Dimension(320, 100));
        return p;
      public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
          public void run() { createAndShowGUI(); }
      public static void createAndShowGUI() {
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        f.getContentPane().add(new ComboRightClickTest().makeUI(f));
        f.setResizable(false); //XXX
        f.pack();
        f.setLocationRelativeTo(null);
        f.setVisible(true);
    class LockingGlassPane extends JComponent {
      public LockingGlassPane() {
        setOpaque(false);
      @Override public void setVisible(boolean isVisible) {
        boolean oldVisible = isVisible();
        super.setVisible(isVisible);
        JRootPane rootPane = SwingUtilities.getRootPane(this);
        if(rootPane!=null && isVisible()!=oldVisible) {
          rootPane.getLayeredPane().setVisible(!isVisible);
      @Override public void paintComponent(Graphics g) {
        JRootPane rootPane = SwingUtilities.getRootPane(this);
        if(rootPane!=null) {
          http://weblogs.java.net/blog/alexfromsun/archive/2008/01/
          rootPane.getLayeredPane().print(g);
        super.paintComponent(g);
    }

  • JPopupMenu - disabling mouse right click

    Hi,
    First of all, before I write the problem here, I searched a lot but I actually could not find the desired solution.
    The problem is;
    I have a JPopupMenu. As you know, all mouse clicks (left click, middle click and right click) do the selection in popup menu and then it tries to perform the related action. Finally, the popup menu disappears. But, what I want actually is that "my popup menu will not respond to the mouse right click and will not disappear after that right click".
    Can anyone say how to make that happen?
    Thanks a lot.

    The following is an example code, and I did not the details of how the popup menu showed. I just showed how the actions are added to the popup menu elements. In this example, in the popup menu there are Text1, Text2 and Text3 selections and their actions are added like in the code. So, my actions are seperate for each element in the popup menu. Now, how can I make the mouse right click will not enter the related selection's actionPerformed (e.g; Text1, Text2) and the popup menu will not disappear?
    public class JPopupMenuTest {
        public static void main(String[] args) {
            JPopupMenuTest popupTest = new JPopupMenuTest();
            JPopupMenu popupMenu = new JPopupMenu();
            popupMenu.add(popupTest.new Text1Action());
            popupMenu.add(popupTest.new Text2Action());
            popupMenu.add(popupTest.new Text3Action());
        class Text1Action extends AbstractAction {
            public Text1Action() {
                super("Text1");
            @Override
            public void actionPerformed(ActionEvent e) {
                // Here is the Text1 action performed
        class Text2Action extends AbstractAction {
            public Text2Action() {
                super("Text2");
            @Override
            public void actionPerformed(ActionEvent e) {
                //  Here is the Text2 action performed
        class Text3Action extends AbstractAction {
            public Text3Action() {
                super("Text3");
            @Override
            public void actionPerformed(ActionEvent e) {
                // Here is the Text3 action performed
    }

  • How to display right-click menu for JPanel?

    Hi...
    I am developing an application to display a JWindow in the screen along with a TrayIcon in the system-tray area. There should be a right-click menu in both the tray icon and JWindow for further options.
    I am able to create a JPopupMenu for tray icon. On right-clicking on the tray icon, the menu is being displayed. But not able to do the same for the JWindow. I am able to capture the right-click mouse event, but not able to display the menu.
    This is how I am displaying the menu for the tray icon
    PopupMenu  popupmenu = new PopupMenu();
    MenuItem  menuitem1 = new MenuItem("Exit");
    menuitem1.addActionListener(new ActionListener()
        public void actionPerformed(ActionEvent exx)
            System.exit(0);
    popupmenu.add(menuitem1);
    trayicon = new TrayIcon(Toolkit.getDefaultToolkit().getImage("./images/Icon.gif"),"Right-click for more options",popupmenu);For displaying the menu in the JPanel, I am using the following snippet...
        public class MyMouseListener extends MouseAdapter
            public class MyMouseListener() {}
            @Override
            public void mouseClicked(MouseEvent e)
                if (e.getButton() == MouseEvent.BUTTON3)
                   System.out.println("Clicked");
                   jp.setComponentPopupMenu(popupmenu);
        }Can anyone please help me to do this??
    Thanks in Advance...

    Hi,
    PFA the code I am using...
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class DisplayStrip extends JWindow implements MouseListener, MouseMotionListener
         Point location;
         MouseEvent pressed;
        JPanel jp ;
        JLabel jl ;
        JPopupMenu popupmenu ;
         public DisplayStrip()
              addMouseListener( this );
              addMouseMotionListener( this );
         public void mousePressed(MouseEvent me)
              pressed = me;
         public void mouseClicked(MouseEvent e) {}
         public void mouseReleased(MouseEvent e) {}
         public void mouseDragged(MouseEvent me)
              location = getLocation(location);
              int x = location.x - pressed.getX() + me.getX();
              int y = location.y - pressed.getY() + me.getY();
              setLocation(x, y);
         public void mouseMoved(MouseEvent e) {}
         public void mouseEntered(MouseEvent e) {}
         public void mouseExited(MouseEvent e) {}
         public void DisplayStripRun()
              setSize(100, 10);
              setAlwaysOnTop(true);
            jp = new JPanel();
              jp.setBackground(Color.GREEN);
              jp.addMouseListener(new MyMouseListener());
              jl = new JLabel();
              jl.setText("Right-click Here");
              jp.add(jl);
              add(jp);
              setVisible(true);
              pack();
              popupmenu = new JPopupMenu();
              JMenuItem menuitem = new JMenuItem("Exit");
              menuitem.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent exx)
                        System.exit(0);
              popupmenu.add(menuitem);
         public static void main(String args[])
              DisplayStrip ds = new DisplayStrip();
              ds.DisplayStripRun();
        public class MyMouseListener extends MouseAdapter
            //public class MyMouseListener() {}
            @Override
            public void mouseClicked(MouseEvent e)
                if (e.getButton() == MouseEvent.BUTTON3)
                   System.out.println("Right clicked");
                   jp.setComponentPopupMenu(popupmenu);
                   popupmenu.setVisible(true);
    }

  • HELP! Both mouse buttons are Right-Click!

    Hi. So I just installed USB Overdrive on my 10.6.1 iMac 2.66, and one of the buttons was conflicting; I thought it might be an issue with Apple's official mouse & keyboard prefs. So I went in, and I accidentally switched the right click/left click, and now I cannot click on ANYTHING because both buttons are right-click. I tried restarting in the hopes that USB Overdrive would override the system prefs, but no dice. Could someone help? Is there any way I can manipulate system prefs without the use of clicking? Thanks!

    xnav wrote:
    Yes, of course. The link was only meant as a reference to get in TM under the DVD (where the mouse should work correctly). The OP should only restore the folder mentioned.
    you can not restore just one folder using TM restore utility on the DVD. you can only restore the whole system. this might be the easiest in this case. otherwise one can try logging in as root. this should be possible since AFAIK, USB overdrive mouse settings are user specific. then one can try restoring just what's needed from the main user home directory.

Maybe you are looking for