Questions tagged [jpopupmenu]

JPopupMenu is the Java Swing implementation of a popup menu, a small window that pops up and displays a series of choices. A JPopupMenu is used for the menu that appears when the user selects an item on the menu bar. It is also used for "pull-right" menu that appears when the selects a menu item that activates it. Finally, a JPopupMenu can also be used anywhere else you want a menu to appear.

JPopupMenu is the Java Swing implementation of a popup menu, a small window that pops up and displays a series of choices. A JPopupMenu is used for the menu that appears when the user selects an item on the menu bar. It is also used for "pull-right" menu that appears when the selects a menu item that activates it. Finally, a JPopupMenu can also be used anywhere else you want a menu to appear.

For information and examples of using popup menus, see How to Use Menus in The Java Tutorial.

255 questions
0
votes
1 answer

JPopupMenu not showing on the screen?

So for my school project I am creating a Class Diagram maker. I am 95% done with it and all I need is to make the Jpopup menu appear. In the core I have 3 files. The ApplicationModel which extends the JFrame, ClassDiagram which extends the JPanel…
user2879331
0
votes
1 answer

JPopup key bindings only work 1 time

I have a static JPopupMenu which I create and assign keybindings to using: JMenuItem mItem = new MenuItem( "name" ); mItem.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_W, ActionEvent.CTRL_MASK ) ); This JPopupMenu is added to a JTable by…
james4563
  • 169
  • 1
  • 13
0
votes
1 answer

MouseExited event triggers when crossing an inner separator?

I have a JPopupMenu which contains an inner JMenu and a separator with addSeparator(). Due to some odd handling, I've added a MouseListener to the JPopupMenu which makes it invisible on a mouseExited event. This works fine, except that when the…
asteri
  • 11,402
  • 13
  • 60
  • 84
0
votes
2 answers

JPopupMenu disappears on mouseEntered

I have next structure: JPopupMenu contains JPanel which contains JMenuItems. The problem is, I cannot use it because JPopupMenu disappears when mouse enters to any menu item. SSCCE: public class PopupTest { public static void main(String[] a) { …
SeniorJD
  • 6,946
  • 4
  • 36
  • 53
0
votes
2 answers

Show/Hide JMenuItems in a JPopupMenu based on a JTree's selection

I 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 on the node selected in the JTree? The first solution that came to mind…
Tom Neyland
  • 6,860
  • 2
  • 36
  • 52
0
votes
2 answers

JPopupMenue and buttons

I want that my program will do the following: for every button to add jpopupmenue-that work when click on one of the buttons to show its jpopupmenue and when: the first JMenueItem was clicked- to change the color of the button that trigger the…
0
votes
2 answers

Changing the combobox starting point

I have a combobox that is put in a 20x20 field, so only the button is shown. When the user clicks the button, it drops down a popupmenu that is 150 wide (using Mark McLaren's WiderDropDownCombo solution). However, the button is on the rightmost…
0
votes
1 answer

Popup menu seems not working

I am trying to trigger a popup menu when user type a specific character .In my case It's dot key.But nothing happens.I think; I missed out something . Could you tell me what is wrong.Because I am completly confused public class d extends JPanel { …
user2583511
  • 173
  • 1
  • 4
  • 12
0
votes
2 answers

JPopupMenu.show shows popupmenu with strange behaviour (sometimes appears as grey box)

I have a JFrame containing a JTabbedPane containing a JPanel in a Tab. In this JPanel, I want a JPopupMenu to show at Mouse Position when clicking the right mouse button. To do this, I use the show(invoker, x, y) method. My Problem: The JPopupMenu…
0
votes
1 answer

How to add MenuItem to Menu of a TrayIcon ,dynamically in java?

I have a ChatServer application , and when ChatServer started a TrayIcon will display in the system tray , When i right click on that Trayicon there is a Menu called who's online , i want to add MenuItem to this menu when a client is connect chat…
Roshan
  • 11
  • 3
0
votes
2 answers

How to directly show a dynamically added item in the popup, without doubleclicking?

I have this PopupMenuListener public class MyPopupMenuListener implements PopupMenuListener { protected JTable _table; public MyPopupMenuListener(JTable table) { _table = table; } @Override public void…
mrt181
  • 5,080
  • 8
  • 66
  • 86
0
votes
1 answer

Sharing Components with multiple containers

I have JTabbedPane and each tab has a JTextPane. Each JTextPane has a popup-menu but I want all of them to share the exact same popup-menu. Why? Because when I switch tabs, I want the same options to be highlighted on each popup. How can I do this?…
Brandon
  • 22,723
  • 11
  • 93
  • 186
0
votes
2 answers

Detecting Keyboard Input while Having a Focus on JpopupMenu (Java)

I would like to know if there is any way to detect a keyboard input while having a focus on JpopupMenu. This is to remove the focus on JPopupMenu whenever there is an input detection from keyboard. Is this possible? Thank you. Below is the…
0
votes
0 answers

right click popup menu is not working properly (in jtable)

its working for first time but after deleting some line it shows blank on popup menu in right click. i think its because of refresh method but i couldn't solve it. private void refresh() { List head = new ArrayList<>(); …
0
votes
1 answer

How to refresh item in a popup menu?

i have a popup menu (that comes out when the user uses right click on specified elements), wich items are readed from a list. I want that when an item is selected, that item is disabled in the popupMenu (then if some action happen it will return…
1 2 3
16
17