Package javax.swing

Examples of javax.swing.JMenuItem.repaint()


            item.setText(scmi.getLabel());
            item.setEnabled(scmi.isEnabled());
            if (scmi.getImage() != null) {
                item.setIcon(new ImageIcon(scmi.getImage()));
            }
            item.repaint();
            contextMenu.pack();
            contextMenu.repaint();
        }
    }
View Full Code Here


                return;
            }

            // Otherwise, highlight the menu item and hide the menu
            item.setBackground(WL_GREEN);
            item.repaint();
            hideContextMenu();

            // Find the listener to dispatch the action to
            ContextMenuItem menuItem = menuItemMap.get(item);
            if (menuItem != null && menuItem instanceof SimpleContextMenuItem) {
View Full Code Here

            // Highlight the menu item with a color, but only if it is enabled
            JMenuItem item = (JMenuItem)e.getSource();
            if (item.isEnabled() == true) {
                item.setBackground(WL_LIGHT_GREEN);
                item.setOpaque(true);
                item.repaint();
                contextMenu.pack();
            }
        }

        @Override
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.