Close « Menu « Java Swing Q&A





1. (Java) JPopupMenu won't close if I click outside of it    stackoverflow.com

I have created a Java Swing app that has no visible main window but which is controlled through its tray icon by right-clicking. I am using a JPopupMenu for this, but when ...

2. JPopupPanel closed when click on its JPopupMenu    stackoverflow.com

I have a JPopupPanel showing up when a button is clicked. This JPopupPanel has a JPopupMenu which shows up with the mouse right click, showing different options. When left button pressed to ...

3. How to prevent triggering of other events when closing a JPopupMenu by clicking outside it?    stackoverflow.com

There are some properties of the right-click context menu I would like to replicate with a JPopupMenu:

  1. When menu is open and you click elsewhere, menu closes.
  2. When menu ...

4. JMenu won't close when clicking elsewhere    stackoverflow.com

I'm trying to make a swing gui but currently experiencing trouble with making JMenus "close" when clicking elsewhere. If a JMenu is selected/open i want it to close when clicking somewhere else ...

5. Why menus and context menus of IntelliJ are instantly closing after beeing opened?    stackoverflow.com

when I open a context menu or menu of the menubar it opens only for some milliseconds and then gets closed instantly. Did you ever experienced such behavior? Any suggenstions to ...

6. Menu not closing directly    coderanch.com

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class EDTTest implements ActionListener { JLabel label; public void actionPerformed(ActionEvent e) { JMenuItem item = (JMenuItem)e.getSource(); String ac = item.getActionCommand(); // everything runs on a single thread - the edt // this means that everyone must wait for the // method that is currently running to (finish) // return before the next in line ...

7. close a frame with menu item    coderanch.com





10. Close Group function via taskbar right-click menu    coderanch.com

In WindowsXP, if you have multiple windows of a program (ex: many notepads, browser windows, etc), program titles on the taskbar gets grouped under the common name. (assumed that user have checked "Group similar taskbar buttons" in "Taskbar and Start menu Properties") This allows user to right-click on grouped program taskbox on the taskbar and click "Close Group" that closes all ...