Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4023772

actionCommand property not set properly in action events on menuitems

XMLWordPrintable

    • 1.1beta3
    • generic, x86
    • solaris_10, windows_95, windows_nt
    • Not verified

       From ###@###.### Mon Dec 30 15:42:13 1996
      X-Sender: pinky@piccolo
      To: java-awt@java
      Subject: java.awt.MenuItem bug (?)
      MIME-Version: 1.0

      I am trying to use the setActionCommand method on java.awt.MenuItem, but
      the ActionEvents that get generated still have the original action command
      string of the MenuItem's title string instead of what I pass in as the
      setActionCommand's argument.

      My code is very simple:

      mi = new MenuItem(m_aMsgMgrInfo[i].sItemLabel);
      mi.setActionCommand("Hey you!!!"); // Integer.toString(i));
      mi.addActionListener(this);

      Later, I print out the ActionEvent's command string, and it contains the
      label, NOT "Hey you!!!" as I would expect.

      I think this is a bug, but I'm not certain.

      Sincerely,

      Donald Pinkston
      Caltech Seismology Lab

            amfowler Anne Fowler (Inactive)
            amfowler Anne Fowler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: