List of utility methods to do JPopupMenu
void | showPopMenuWithParentWidth(JPopupMenu popup, Component parentComponent, int x, int y) show Pop Menu With Parent Width if (popup == null) { return; Dimension size = popup.getPreferredSize(); size.width = Math.max(size.width, parentComponent.getWidth()); popup.setPreferredSize(size); showPopupCloseMenu(popup, parentComponent); |
void | showPopup(JPopupMenu popup, MouseEvent event) Ensures that the popup menue is allways inside the application frame if (popup == null) { return; final Component component = event.getComponent(); final Point point = event.getPoint(); popup.show(component, point.x, point.y); |
void | showPopupCloseMenu(JPopupMenu popup, Component parentComponent) show Popup Close Menu if (popup == null) { return; Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Window frame = SwingUtilities.getWindowAncestor(parentComponent); int leftX = 0; int rightX = parentComponent.getLocation().x + frame.getLocation().x + popup.getPreferredSize().width; if (rightX > screenSize.width) { ... |
void | showPopupMenu(final JPopupMenu popup, final Component component, int x, int y) show Popup Menu final Point p = new Point(x, y); SwingUtilities.convertPointToScreen(p, component); final Dimension size = popup.getPreferredSize(); final Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); boolean horiz = false; boolean vert = false; final int origX = x; if ((p.x + size.width > screen.width) && (size.width < screen.width)) { ... |
void | showPopupMenu(javax.swing.JPopupMenu popup, Component comp, int x, int y) Shows the specified popup menu, ensuring it is displayed within the bounds of the screen. Point p = getBestAnchorPoint(comp, x, y); popup.show(comp, p.x, p.y); |
void | showPopupMenu(javax.swing.JPopupMenu popup, Component comp, int x, int y) Shows the specified popup menu, ensuring it is displayed within the bounds of the screen. Point p = getBestAnchorPoint(comp, x, y); popup.show(comp, p.x, p.y); popup.show(comp, x, y); |
void | showPopupMenu(JPopupMenu menu, Component invoker, MouseEvent e) Displays a popup menu. showPopupMenu(menu, invoker, e.getXOnScreen(), e.getYOnScreen()); |
void | showPopupMenu(JPopupMenu popup, Component comp, int x, int y) Shows the specified popup menu, ensuring it is displayed within the bounds of the screen. showPopupMenu(popup, comp, x, y, true); |
void | showPopupMenu(JPopupMenu popup, Component comp, int x, int y) Shows the specified popup menu, ensuring it is displayed within the bounds of the screen. Point p = new Point(x, y); SwingUtilities.convertPointToScreen(p, comp); Dimension size = popup.getPreferredSize(); Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); boolean horiz = false; boolean vert = false; int origX = x; if (p.x + size.width > screen.width && size.width < screen.width) { ... |
void | showPopupMenu(JPopupMenu popup, Component comp, int x, int y) Shows the specified popup menu, ensuring it is displayed within the bounds of the screen. showPopupMenu(popup, comp, x, y, true); |