Package javax.swing

Examples of javax.swing.JPopupMenu.show()


      if (e.isPopupTrigger()) {
        TreePath path = getPathForLocation(e.getX(), e.getY());
        if (path != null && listener != null) {
          JPopupMenu menu = listener.menuRequested(new Event(path));
          if (menu != null) {
            menu.show(ProjectExplorer.this, e.getX(), e.getY());
          }
        }
      }
    }
    public void mouseClicked(MouseEvent e) {
View Full Code Here


    setSelectedIndex(inx);

    if (getModel().getElementAt(inx) instanceof Program) {
      Program prog = (Program) getModel().getElementAt(inx);
      JPopupMenu menu = mng.createPluginContextMenu(prog, caller);
      menu.show(ProgramList.this, e.getX() - 15, e.getY() - 15);
    }
  }

  public void stateChanged(ChangeEvent e) {
    repaint();
View Full Code Here

   */
  private void showPopup(MouseEvent evt, ContextMenuIf caller) {
    if (SwingUtilities.isRightMouseButton(evt)) {
      JPopupMenu menu = PluginProxyManager.createPluginContextMenu(mProgram,
          caller);
      menu.show(evt.getComponent(), evt.getX() - 15, evt.getY() - 15);
    }
  }

  /**
   * Should be called, when the program has changed.
View Full Code Here

    JPopupMenu menu = new JPopupMenu();
    addStandardContextMenu(tc, menu);

    Point pt = SwingUtilities
        .convertPoint(me.getComponent(), me.getPoint(), tc);
    menu.show(tc, pt.x, pt.y);
  }

  public static void addStandardContextMenu(JTextComponent tc, JPopupMenu menu) {
    if (menu.getSubElements().length > 0) {
      menu.addSeparator();
View Full Code Here

    });
   
    menu.add(item);
    menu.add(ContextMenu.getSubMenu());

    menu.show(e.getComponent(), e.getX(), e.getY());
  }

  private void addButtonProperties(final AbstractButton button,
      final Action action) {
    String tooltip = (String) action.getValue(Action.SHORT_DESCRIPTION);
View Full Code Here

    mTable.changeSelection(row, 0, false, false);

    Program p = (Program) mTable.getModel().getValueAt(row, 0);

    JPopupMenu menu = PluginManagerImpl.getInstance().createPluginContextMenu(p, ReminderPluginProxy.getInstance());
    menu.show(mTable, e.getX() - 15, e.getY() - 15);
  }

  public void close() {
    dispose();
  }
View Full Code Here

                Object obj = it.next();
                if (obj instanceof java.awt.Component) {
                    jpm.add((java.awt.Component) obj);
                }
            }
            jpm.show((java.awt.Component) me.getSource(), me.getX(), me.getY());
            return true;
        }
        return false;
    }
View Full Code Here

            launchButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ae) {
                    JButton button = getLaunchButton();
                    JPopupMenu popup = new JPopupMenu();
                    setGUI(popup);
                    popup.show(button, button.getWidth(), 0);
                }
            });
        }
        return launchButton;
    }
View Full Code Here

                setPreStrokeMenuOptions(popup);
                setStrokeMenuOptions(popup);
                setPostStrokeMenuOptions(popup);

                popup.show(button, button.getWidth(), 0);
            }
        });

        toolbar.add(lineButton);
View Full Code Here

                }
               
                if (list.getSelectedIndex() > -1) {
                    JPopupMenu menu = getPopupMenu();               
                    menu.setInvoker(list);
                    menu.show(list, e.getX(), e.getY());
                }
            }

            if (e.getClickCount() == 2 && list.getSelectedIndex() > -1)
                open();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.