Select « Menu « Java Swing Q&A





1. How to select first item in JPopupMenu?    stackoverflow.com

In the past, when one made a JPopupMenu visible it's first item would get selected by default: http://weblogs.java.net/blog/alexfromsun/archive/2008/02/jtrayicon_updat.html Nowadays the default behavior is to pop up the menu without any ...

2. how to stop JPopupMenu show() from visually un-selecting the list item clicked on    stackoverflow.com

Right now when a user right clicks on a selected JList item in my program the resulting JPopupMenu clears the selection (at least visually) until the popup menu is closed. This ...

3. JRadioButton in JPopupMenu does not close the menu after selecting    stackoverflow.com

With the above code i want to close the popup right after click on one of the radio buttons but the popup stays open. Is there something build-in in swing or must ...

7. Selecting A Menu Item    coderanch.com

8. can not select item in jpopupmenu    coderanch.com

9. Selecting font for tray icon menu to display Cyrillic    coderanch.com

I met a strange problem. When I setup language as "ru", system tray messages and tooltips are displayed correctly, but popup menu item. All Cyrillic in popup menu is displayed as block characters. I tried to change font, but it doen't help much. Does somebody know how to create font to assure that Cyrillic part is present, or I need just ...





10. displaying different contents based on the menuitem selected on the same jpanel    coderanch.com

Hi, I have this desktop application where the data has to be dispalyed in different ways(along with varied buttons and textfields) based on the Menuitem selection, in the same part of the JFrame So I add jPanel1(has its own set of jtextfileds and button) ,jpanel2 and jpanel3 to dataDisplayPanel(a jPanel). And set them all as invisible. ---- Am using NetBeans IDE ...

11. How to obtain text from Selected Menus    java-forums.org

Java Code: import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; public class Breadcrumbs { JFrame frame = new JFrame(); MenuSelectionManager manager = MenuSelectionManager.defaultManager(); public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { new Breadcrumbs().makeUI(); } }); } public void makeUI() { JMenuItem level1 = new JMenuItem("Level 1"); JMenuItem level2 = new JMenuItem("Level 2"); JMenu french = new JMenu("French"); ...

12. Returning the selected menu item from a popup screen    java-forums.org

Hi. I'm having trouble returning what item has been seect from a popup window. When I right click I get my menu-popup, but when I click on a menu item I get nothing. I've added an action listener to the popup menu. My menu is a sub-menu and I'm trying to get information back from my sub menu. Any tips please? ...

13. Selecting a JMenu paints over the JPanel on the content pane    java-forums.org

Hi. Cheers for replying. I'll try and go into a bit more detail. I've got a class which extends a JPanel. I've got some boolean variables which can be set by calling methods (e.g. blankScreen). The JPanel's repaint() method is then called. I've overriden the paintComponent() method to call certain methods dependent on the value of the booleans. The appropriate method ...

14. JMenuItem selected    forums.oracle.com

15. Multiple selection in JPopupMenu    forums.oracle.com

Hi I was in need of allowing multiple selection in JPopupmenu.... I had 50 checkBocMenuitems in JPopupmenu.... Default behaviour of JPopupmenu is if an action that means a selection is done then the popupmenu will gets disappear.. But i want to select multiple items and then want the popupmenu to disappear.. can anyone help me... ThankQ Chalu