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
2 answers

How to add MouseListener to JList model

I have simple sample of code. How can I to add Mouse Listener for displaying simple menu(when i clicked on right mouse button) for selected JList item? In addition: how can I to add Mouse Listener for left mouse button? Like this: Here is my…
veinhorn
  • 2,363
  • 6
  • 21
  • 33
0
votes
1 answer

JMenuPopup not accurte?

Image of the problem: http://gyazo.com/56c4f7f5fc10805695fc80de567b92c5.png private JButton settingsButton = new JButton("Settings"); private JPopupMenu settings = new JPopupMenu(); private JMenuItem accounts = new…
user2192658
  • 41
  • 1
  • 5
0
votes
0 answers

JMenu's pop-up will not close when the cursor leaves the JMenu

JButton jButton1 = new JButton("Click Me"); public void showPopupMenu1(JButton invoker){ JPopupMenu popupMenu = new JPopupMenu(); popupMenu.setLayout(new GridLayout(5, 1)); JMenu menu = new JMenu("Other"); menu.add(new…
imarefe
  • 5
  • 4
0
votes
2 answers

JPopupMenu's MenuItems not responding to changes... why?

I noticed that once my JPopupMenu becomes visible for the first time, its MenuItems do not reflect changes made to them for the next visibility. Here is the code; private static void addListener(final JPopupMenu popup, final String someLetter) { …
SourceVisor
  • 1,868
  • 1
  • 27
  • 43
0
votes
1 answer

Custom JMenuItem

Would it be possible to create a custom JMenuItem that contains list of checkbox? Example is the excel filter popup menu: So far, what I've done is like this: JPopupMenu headerPopup = new JPopupMenu(); JMenuItem clearfilter = new JMenuItem ("Clear…
imarefe
  • 5
  • 4
0
votes
1 answer

How to animate showing of JPopupMenu?

I'd like to show increasingly more of a JPopupMenu so it appears to "slide out". It's not for menu items, where animation doesn't make too much sense. Instead it's for a panel with some real components (oh yeah, you can add any JComponent to…
Geoffrey Zheng
  • 6,562
  • 2
  • 38
  • 47
0
votes
2 answers

JPanel inside PopupMenu

Is there a way to render graphics like JPanel in a PopupMenu (with TrayIcon)? I know it's possible by using JPopupMenu but I do not like that the popup doesn't close if I click outside of it (and the icon does not get highlighted as with…
Niclas Larsson
  • 1,317
  • 8
  • 13
0
votes
1 answer

Is the area too small for JPopupMenu?

In the last question I was asking the community why my JPopupMenu did not appear on the screen. I was unable to come up with a simple , runnable, compilable example. So, here is what I did for you guys: Is the area too small to draw a popup? I…
An SO User
  • 24,612
  • 35
  • 133
  • 221
0
votes
0 answers

PopupMenu and JTable

I try to create a popup menu that contains a JTable and that can show other popup menu. The JTable has mouse listener so that when a menu item has other item to show a new JPopupMenu is created with a JTable inside and so on. The problem I have is…
jerome
  • 2,029
  • 4
  • 38
  • 58
0
votes
1 answer

add panel to combobox popup menu

i have jFrame = frame it have jcombobox = combo then i have jpanel = panel i have many component inside this panel i try to add this panel into combobox popupmenu so if combobox clicked, panel that have many components will show up it is possible to…
Jason Amavisca
  • 187
  • 3
  • 5
  • 13
0
votes
1 answer

Java PopupMenu Checkbox System Tray

I'm making an application where I want a checkbox in my java popupmenu(shown below) for the option run at start-up. Heres the popupmenu: https://i.stack.imgur.com/JLZQE.jpg How do i made the Run at start-up option a check box.
Jonathan Beaudoin
  • 2,158
  • 4
  • 27
  • 63
0
votes
0 answers

JPopUpMenu does not hides/close when clicking outside my GUI

I have a swing GUI on Mac OSX, in which i have a JTable, when i click on JTable a JPopupMenu appears which has different options. Problem is that when i right click and JPopupMenu appears. and suddenly i click outside my GUI my JPopupMenu is still…
Asghar
  • 2,336
  • 8
  • 46
  • 79
-1
votes
1 answer

Can you change the order of JMenuItems?

This a really straightforward question. Can I change the order of JMenuItems in a JPopupMenu? Or is there a way to specify something like an index when adding a menu item to a popup menu like you can with a list (e.i. List.add(int,…
Cardinal System
  • 2,749
  • 3
  • 21
  • 42
-1
votes
1 answer

why JTable header column is set dragged?

In a JPanel form there is a JTable. For some reason I've started receiving the following error when opening the form second time (and all following times) after doing some operations in it: Exception in thread "AWT-EventQueue-0"…
asph galax
  • 19
  • 6
-1
votes
1 answer

Show a JPopupMenu according to the location

I would like to know how to pop up a JPopupMenu that shows up only in a specific range, for example between (200,300) and (400, 400).
Mr. Liu
  • 337
  • 1
  • 3
  • 8
1 2 3
16
17