1. Show/Hide JMenuItems in a JPopupMenu based on a JTree's selection stackoverflow.comI have a JTree which displays a JPopupMenu when I right click nodes in the JTree. What is the best way to hide/show or enable/disable certain JMenuItems in my JPopupMenu based ... |
2. Problem with JPopupMenu in a JTree stackoverflow.comHi guys I have this issue. In a custom JTree I implemented a JPopupMenu to display different JMenuItem according to the node selected using a MouseListener. The JPopupMenu is shown when the ... |
3. JTree inside a JPopupMenu coderanch.com |
4. JPopupMenu inside a Jtree coderanch.comfinal JPopupMenu popupMenu = new JPopupMenu(); JMenuItem shutdownMenuItem = new JMenuItem("shutdown"); popupMenu.add(shutdownMenuItem); tree.addMouseListener( new MouseAdapter() { public void mousePressed(MouseEvent e) { if (popupMenu.isPopupTrigger(e)) { System.out.println("please be a popup trigger"); } int selectedRow = tree.getRowForLocation(e.getX(), e.getY()); if (selectedRow != -1) { if (SwingUtilities.isRightMouseButton(e) == true) { tree.setSelectionRow(selectedRow); popupMenu.show(tree, e.getX(), e.getY()); } } } }); |
5. Renaming tree node with JPopupMenu coderanch.comI am a newbie to swing, i need help to get started with... I have a JTree with few nodes, on right clicking i should be able to popup a menu that contains option for renaming the node and when the user clicks on the menu option the node should be renamed, the new name should be validated for text only ... |
6. JTree added to a JPopupMenu looses key arrow up-down navigation forums.oracle.com |