Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6902487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:48:14+00:00 2026-05-27T07:48:14+00:00

Generic code… For some reason my JMenuItem is not performing actions. I made a

  • 0

Generic code…

For some reason my JMenuItem is not performing actions.

I made a frame, a JMenuBar and a JMenuItem, everything is where it should be. I can click the JMenuItem just fine, it highlights and closes the menu properly but no action is performed.

I added a key to the ActionMap with the JMenuItems name. I also added a key to the Input map with the exact same name and it fires fine.

    'menuitem'.setActionMap(getActionMap());
    System.out.println('menuitemname'.getActionMap().size());
    System.out.println('menuitemname'.getActionCommand());

returns 1 and the correct action key, respectively. Clicking the menu item does nothing. Is there something I’m missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:48:15+00:00Added an answer on May 27, 2026 at 7:48 am

    You are probably looking for the setAction() method (and maybe setActionCommand() as well).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the situation: We have some generic graphics code that we use for one
I have some fairly generic code which uses preprocessor macros to add a certain
I have a class that does some generic code for Writing to a Database.
I'm trying to write generic code that can lex any stream of characters (
I have some generic code which I cannot figure out how to legitimately prevent
Does a framework allow you to abstract generic code - but not in a
I have some generic code for deleting pointers within a vector or a value
I have some generic code which implements Pareto rule. It seems like well-formed code.
A recent question here made use of the default keyword in non-generic code that
I am using the following generic code to save entities. using (ITransaction tx =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.