Submenu « Menu « Java Swing Q&A





1. JPopupMenu bug/glitch(?) when showing submenu    stackoverflow.com

I have this strange bug with my popup menu. It happens rarely and seemingly randomly. The problem is when I have a submenu in my JPopupMenu - when I select the ...

2. Making JPopupMenu's submenus heavyweight    stackoverflow.com

http://java.sun.com/products/jfc/tsc/articles/mixing/index.html advices how to make JPopupMenus heavyweight. Just set the property:

setLightWeightPopupEnabled(false);
It works fine, but if I have submenus in the popup, implemented as JMenu items, they don't seem to ...

3. Problem with submenu in java    stackoverflow.com

My code works correctly, except for the submenu. The "Import" button is supposed to expand into newsfeed, bookmarks, and mail. However, the program doesn't even display "Import". It displays the first ...

4. How To Create a Pop Up Menu with Sub Menu in Java    stackoverflow.com

I would like to add right click menu for my program. I added basit menu with the following code:

            Pmenu ...

5. Java Submenu ActionListener Does Not Work Properly    stackoverflow.com

I added right-click submenu to my program with the following code,

JPopupMenu pmenu = new JPopupMenu("Menu");

            JMenu sectionsMenu = new JMenu("Tickness"); ...

6. Query on Sub Menu??    coderanch.com

This should be, what you want. Have you ever tried using any IDE (JBuilder, VisualAge ...)? import javax.swing.*; import java.awt.event.*; public class CloseFrameOnExit extends JFrame { JMenuBar jMenuBar1 = new JMenuBar(); JMenu jMenu1 = new JMenu(); JMenuItem itemExit = new JMenuItem(); public CloseFrameOnExit() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } public static void main(String[] args) { CloseFrameOnExit ...

7. Calling of servlet from sub menu's actionPerformed??    coderanch.com

Here's some code that shows how to get the HTML data from a URL and how it comes back... just replace "http://www.javaranch.com" with your URL... import java.awt.event.*; import java.io.*; import java.net.*; import javax.swing.*; public class WebLoader extends JFrame { private JMenuItem launchJR; private JTextArea text; public static void main( String[] arg ) { new WebLoader(); } public WebLoader() { super( "Web ...

8. Submenu in a submenu does not open when the mouse moves over it    coderanch.com

I have a web browser application with a favorites menu. The menu has an two options to import favorites from IE and Firefox. When the application imports favorites from IE, it places the favorites as items under the import option. If there are folders of favorites, it will add a submenu containing the favorites in the folder. The problem I have ...

9. JMenu as a submenu    coderanch.com





10. submenu's actionevent    coderanch.com

11. JMenu Submenu    coderanch.com

Hi there. For some reason, I can't get the following code to have the desired effect of creating a submenu using JMenu. I've tried various different approaches to the problem, but all without success thus far. Can anyone point out where I'm going wrong/suggest a solution? --------------------------------------------------------------- // create the lot menu JMenu lotMenu = new JMenu("Lots"); for(int i=0; i < ...

12. how to add a submenu    coderanch.com

13. Adding Submenu to JMenuItem.    coderanch.com

14. applying actionlistener to a dynamic submenu    coderanch.com

Following example works for me: import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.lang.reflect.InvocationTargetException; import javax.swing.AbstractAction; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; /** * DynamicMenuDemo (DynamicMenuDemo.java) * @author peter.taucher * @since 09.06.2010 */ public class DynamicMenuDemo extends JFrame { final JMenuBar menuBar; final JMenu fooMenu; final JMenuItem[] fooMenuItems; public DynamicMenuDemo() { super( "Foo" ); setDefaultCloseOperation( DISPOSE_ON_CLOSE ); menuBar = new ...