title: Update JMenu in Swing via revalidate() and repaint() not working
body: <p>In the process of logging in, if the administrator is being logged in I want to enable JMenuItem called <em>Admin</em>. When program starts, its visibility is set to false. So when a user clicks <em>Log In</em> I run JMenu again and trying to recreate it just with <em>Admin</em> now set on true. Here's the code of my initialize method that's being run if it detects the user is an admin. The method is inside the JMenuBar class that the application uses.</p>
  
  <pre><code>public void initialize() {
  
      file = new JMenu("File");
      file.setName("File Menu");
      file.addMouseListener(this);
  
      help = new JMenu("Help");
      help.setName("Help Menu");
      help.addMouseListener(this);
  
      login = new JMenu("Login");
      login.setName("Login Menu");
      login.addMouseListener(this);
  
      language = new JMenu("Language");
      language.setName("Language Menu");
      language.addMouseListener(this);
  
      admin = new JMenu("Admin");
      admin.setName("Admin Menu");
      if(LoginDialog.AdminLoggedIn) {
          admin.setEnabled(true);
      } else
          admin.setEnabled(false);
      admin.addMouseListener(this);   
  
      add(file);
      add(login);
      add(help);
      add(language);
      add(admin);
  
      this.revalidate();
      this.repaint();
  
  }
  </code></pre>
  
  <p>Thanks.</p>