Popup « Menu « Java Swing Q&A





1. Showing popup menu to menu item    stackoverflow.com

My problem is this I want to show a popup menu to a menu item in java, this i can easily achieve, but when i am showing the popup menu the parent ...

2. Open a window-popup from JMenuItem java    stackoverflow.com

I have a JMenu with a JMenuItem, and when I click on this, I need to open a JFrame or window, in other words a component with inside JButton, JTextField,... How can ...

3. Adding custom elements to a JPopupMenu    stackoverflow.com

The problem can be stated in two different ways: 1. I have a JPopupMenu where I want to insert a component which is not a JMenuItem (a custom JTree)... but I dont ...

4. Adding popup menu items to JChart2D's ChartPanel    stackoverflow.com

Is it possible to add menu items to JChart2D's ChartPanel pop up menu, considering the class doesn't actually save the JPopupMenu created by the LayoutFactory?

5. Java Swing: popup : display small icon in menu    stackoverflow.com

I have a right click popup menu that works fine. I now want to add a little image next to the text. I managed to display the image in the popupmenu but its ...

7. regarding popup menu!    coderanch.com

sir, I want some clarifications.. 1.In Sun Examples he is given the setUIFactory method in UIManager, but in JavaDoc i cont able to find the above method in the class. and there is no package named as 'rose' in swing. this i need for the setting UIFactory to RoseFactory to get the L&F. So, Plese kindly Help me in this regard. ...

8. Popup menu    coderanch.com

9. pop up menu    coderanch.com

namaste gurus, will any one thr help me out??? i hv attached a pop up menu to my JDialog. the prob whch i am facing is tht even wthout right click, just by left clk of the mouse the menu pops up! its strange! i am givg a snippet of my code for better understanding.... cp is object of Container i;e ...





10. popup menu query    coderanch.com

11. How to make a popup Window, not Menu    coderanch.com

I want to put a button on my panel that, when pressed, will generate a new modal window that I can customize just like a regular application JFrame. I've looked at the Java Sun tutorials and the API docs, but for some reason I am just not seeing how to do this. The only other requirement is that I can retrieve/set ...

12. Default Popup menu....    coderanch.com

13. JTabbedPane & Popup Menu    coderanch.com

14. JPopUPmenu Problem of PopUp scroll    coderanch.com

I am assumming that the textfield is at the bottom of the screen. I have a JPopMenu. which is displayed when a text field is pressed If the menu contains morethan 10 items,(basically popmenu goes beyond the screen),then Popup dispalys 10 and then scrolling is not done.. should have to do something so that PopUp scroll happens.. thanks and Regards vinaya ...

15. pop up menu    coderanch.com

16. pop-up window(not pop-up menu)    coderanch.com





17. SWT Table Header Popup Menu?    coderanch.com

18. A drawing question (popup menu & hot spot & extension line)    coderanch.com

Hi folks, I really need some advice on how to implement features below: A user clicks an icon (I will provide it), then clicks again in a drawing area, a shape represented by the icon will be there. If a user (right) clicks on the shape, a popup menu will come out with several options, like Add a solid line, convert ...

19. How to add popup menu on button    coderanch.com

20. Copy and paste popup menu    coderanch.com

You just gave it a name - you still need to assign an action to it. Try something similar to this: private JPopupMenu getJPopupMenu() { if (jPopupMenu == null) { jPopupMenu = new JPopupMenu(); Action copyAction = new AbstractAction(DefaultEditorKit.copyAction) { public void actionPerformed(ActionEvent e) { // text is your text field text.copy(); } }; JMenuItem copy = new JMenuItem(copyAction); jPopupMenu.add(copy); } ...

21. Popup menu not responding with mouse event    coderanch.com

i have added popupmenu to the applet...based on the menu selected methods 'll be called..now the problem is,for all menu selection only a particular method is called..can anyone say me where i'm going wrong.. import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; import javax.swing.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.font.FontRenderContext; import java.awt.font.LineMetrics; import java.text.ParseException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import ...

22. Popup Menu    coderanch.com

public void mouseClicked(MouseEvent evt) { if (evt.getButton() == MouseEvent.BUTTON3) { Component source = (Component)evt.getSource(); int x = evt.getX(); int y = evt.getY(); popUp(source, x, y); } } public void popUp(Component invoker, int x, int y) { jpMenu = new JPopupMenu(); item1 = new JMenuItem("ITEM 1"); item2 = new JMenuItem("ITEM 2"); jpMenu.add(item1); jpMenu.add(item2); jpMenu.show(invoker, x, y); }

23. how to minimize a window to system tray , and how to restore it from trayIcon's popup menu....???    coderanch.com

in a swing application, we add a sysem tray icon to the application... but, how can we minimize the window to notificaiton area instead of normal window minimize operation... we added a pop up menu to tray icon... by handling mouse events we can quit the application by using exit(0) function... but how can we restore a minimized window... please explain... ...

24. How to display Right-click popup menu in JPanel?    coderanch.com

ujjal dey wrote:Hi All, In my application, a JPanel gets displayed in a JWindow. I need to add a right-click menu (with 'Exit' and 'About') in that JPanel. I am not able to add the popup menu in the JPanel. Can anybody please help me out??? Any pointer would be helpful. Thanks in advance... This is a sample test using JPopup.. ...

25. Prevent hide popup menu    coderanch.com

Hi all, I've created a popup menu with comboboxes which is brought forward upon a button click. I would like to prevent it from hiding when i check or on check combobox(es). Please give me an advice coz for the moment my popup menu disappears each time i check/uncheck a combo. if (jScrollPane == null) { jScrollPane = new JScrollPane(); jScrollPane.setViewportView(getJTableClient()); ...

26. Right click popup menu    coderanch.com

Hi. I added a right click popup menu to my codes with the help of Netbeans 6.7.1 to auto generate the codes. It worked on Linux platform ( my development platform is on Linux ). i wanted to test it out on Windows to see how it worked so i deployed it on a win XP Home Edition with the latest ...

28. JButton with a pop up menu    coderanch.com

I have a JButton that I want to add a menu to, I was using a mouseClicked and listening for 1 or 2 clicks, 2 bringing up the menu. The problem is that this button fires a single click to quickly and it is hard to get a double click in. So I create an arrow icon to memic a drop ...

29. Popup menu appears outside the frame    coderanch.com

In my application,a few internal frames open up.and in each frame,a graph is laid out.(I'm using JGraph).So I have set up a popmenu for every vertex of my vertex. It works absolutely fine with small graphs where I dont have to scroll.My problem is that when the graph gets bigger i.e when I have to scroll down, the pop menu appears ...

30. add PopUp menu by NetBeans    java-forums.org

31. Regarding popup menu in netbeans IDE    java-forums.org

32. How can I add popUp menu on a tab of a tabbedPane?    java-forums.org

I want to add a popUp menu on a tab of a TabbedPane when I click on the tab.That is,suppose,there are two tabs A and B.When I clicked on A,there will appear a popup menu on A and when I clicked on B there will be another popUp menu on B.How can I do this?plz give me suggestions.The popUp menus will ...

33. Adding different popup menus to different buttons.    java-forums.org

I am making a game and I am stuck on something. In a loop I want to fill buttons with data from an Vector. Each one should have a different JPopupMenu on right click. If the item is a sword, and I right click on the button, it should say Equip sword and Destroy sword. Item Class Java Code: import java.util.Vector; ...

34. JPopupMenu : how can I know when the mouse leaves the popup?    forums.oracle.com

hello, i would map mouse coordinates to screen coordinates, and have the an x/y int for the top left of the popup, using formula to for the popup size (eg 100x100) to find its exact "screen" coordinates. Then you can try to make your program find out if your mouse lies in same screen area as the popup. But im quite ...

35. JpopupMenu doesn't popup in Java6    forums.oracle.com

I have a window set up as a drop target for receiving urls and files. When files or urls are dropped, a popup menu is generated based on what has been dropped and then the menu is shown. In Java 1.4 this all worked fine when the Drop Target window extended JWindow, but not now in J6. The only way I ...