Questions tagged [jpopup]

33 questions
1
vote
1 answer

How do I fire click() event whenever i click on any item in the popupmenu in java?

I want to add a window on clicking the menu item of a right click popupmenu in Java swing(seems like a simple task...but not getting) I got it to partly work by adding a custom menuitem in popupmenu adding a window on right click But this only…
1
vote
2 answers

Find owner of combobox popup

I have a popup with settings displayed to the user. If you click outside it, its hidden but if you click inside it remains visible. The event handler handling this behavior gets the Component (that was clicked) and by using component.getParent()…
Mizipzor
  • 51,151
  • 22
  • 97
  • 138
1
vote
3 answers

How to adapt left-click action on JTable to the right-click in java?

I have a JTable which I want to have left-click and right-click JPopupMenu on it. Normaly by left-click on the JTable you can select a row. I would like to do the same with right-click plus show up a popup menu. Does anybody know how to do…
itro
  • 7,006
  • 27
  • 78
  • 121
1
vote
1 answer

Swing: mouse event on JTree or other components becomes skipped sometimes

I need to show popup-menu on my JTree, and I added mouse listener just like that: tree.addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent me){ if (SwingUtilities.isRightMouseButton(me)){ //.. some code…
Dmitry Frank
  • 10,417
  • 10
  • 64
  • 114
0
votes
2 answers

popUp method repeats when I repeat the process Twice or More

the showPopUpPassword work fine when I input incorrect password for the first time, but when i repeat it for the 2nd time or more. it still popUp after the JOptionPane.showMessageDialog(null, "incorrect password"); table.addMouseListener(new…
Orville
  • 518
  • 7
  • 17
0
votes
1 answer

Swing popup menu on a component and its content

I have a component (Widget - extends a JPanel) on which I have implemented a simple popup menu. It works when clicking on the border of the panel and basically everywhere except for the places where the panel layout contains some other component…
Smajl
  • 7,555
  • 29
  • 108
  • 179
0
votes
1 answer

How to force a scrollable popup menu to scroll to a specific menu item?

I have a Java Swing application, and i have created a special sub JPopupMenu for it that is scrollable so a user can simply scroll through it and select one item from it, like in this screenshot : I have used the code from this post and i have…
Brad
  • 4,457
  • 10
  • 56
  • 93
0
votes
0 answers

getPopup() of PopupFactory not called on Mac

I have extended javax.swing.PopupFactory class and override getPopup(). Also I have set as shared instance for PopupFactory. I have put logs in getPopup() method. On Windows I can see the logs of getPopup(). But on Mac the logs are not showing. It…
user3759750
  • 123
  • 3
  • 10
0
votes
1 answer

Add the selected item of a popup menu to a text field which is in same form

How to add the selected item of a popup menu to a text field which is in same form? I have created a form using Swing. I am posting the code below. I want the selected item of my pop-up menu to be added to a text field. As I am new to the topic.…
Debaprasad
  • 126
  • 4
  • 23
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

Java with multiple JPopup

I am trying to build some very basic interactive GUI for a chess-game. The idea is to help players by allowing them to get "help" by allowing them to click on each chess-piece and see suggestions about what moves to make and such. The only…
user1938803
  • 189
  • 2
  • 10
0
votes
1 answer

Right click not working on JFrame

I have been working on how to enable the right click and show a popup menu it was asked earlier at Enable right click in jFrame but it was not as useful actually my problem is that I am facing the left click as enable also my piece of code that I…
Tech Nerd
  • 822
  • 1
  • 13
  • 39
0
votes
1 answer

set MenuItem unclickable in SystemTray

I want to set my Menuitem in Java unclickable. It should be shown, but not clickable and there shouldn't be a hover color, when you go with your mouse over it. In other words, I want to show a text for info in System-Tray menu. It has no onclick…
bbholzbb
  • 1,832
  • 3
  • 19
  • 28
0
votes
3 answers

How to wait for popup menu closing in swing

I'm new to swing and I'm sure there is an another way, but due of some akward api desing I have to implememnt a handler that recives MouseEvent and return an resault. I would like to show popup menu to user and wait for it to close and return value…
user629926
  • 1,910
  • 2
  • 18
  • 43
0
votes
1 answer

How init JCalendar with no default date

i'm using JCalendar and i initialize it in this way: popup = new JPopupMenu(); calendar = new JCalendar(); popup.add(calendar); calendar.addDateListener(new DateListener() { @Override public void dateChanged(DateEvent de) { Calendar c…
Jayyrus
  • 12,961
  • 41
  • 132
  • 214