Top "Jmenu" questions

How to make a JMenu item do something when it's clicked

I'm making a GUI that has a Jmenu; it has the jmenu items that will be doing things when clicked. …

java swing user-interface jmenu jmenuitem
Change background and text color of JMenuBar and JMenu objects inside it

How can I set custom background color for JMenuBar and JMenu objects inside it? I tried .setBackgroundColor and it does …

java swing look-and-feel jmenu jmenubar
JMenu ActionListener

I was wondering if can you test to see if a JMenu (not JMenuItem) has been clicked. I tried adding …

java swing actionlistener jmenu
How to make a JMenu have Button behaviour in a JMenuBar

I was trying to make a JMenu behave like a JButton but I'm having some problems and hopefully someone here …

java swing jmenubar jmenu
Aligning JMenu on the right corner of JMenuBar in Java Swing

So if i have a JMenu & JMenuBar defined such that: jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.…

java swing jmenu jmenubar
Adding a submenu

So I tried to look at the Java docs for help for this but got confused pretty quickly. I am …

java swing jmenu jmenuitem
How to set a size for JMenuItem?

As you can see, it's ugly to have these kind of JMenuItems. The width of the menu items is quite …

java swing jmenu jmenuitem preferredsize
Height of JMenuBar, JMenu and JMenuItem

Is it possible to set height of JMenuBar, JMenu and JMenuItem using UIManager once for all menus? I am currently …

java swing jmenu jmenuitem jmenubar
Swing: creating a checkbox or check symbol in menuItem of jMenu

I want to create a checkbox or check symbol in front of menuItem in a JMenu. For example, when we …

java swing jcheckbox jmenu jmenubar
How do I create this special menu bar with Java Swing?

I am trying to implement this type of menu using Swing. Is there any off-the-shelf solution (free and/or commercial) …

java swing icons jmenu jmenuitem