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

Doc: PopupMenu's API documentation does not specify anything abt it's parent

XMLWordPrintable

    • generic
    • generic

      The show() method of the AWT popup menu specifies that it would throw a NullPointerException when popup menu's parent is null. But nowhere in the specification, it is mentioned that a popup menu must be added to a component. Only after looking into the tutorials, I figured out that it must be added to the component. It's highly unlikely that a new developer can guess this as it is not a very common practice to add something to a component. Developers may be used to adding components to containers but this is a bit different.

      It is true that any developer can figure out somehow by looking into the tutorials and other documents but I feel it would be better to elborate the API doc a bit for PopupMenu on this. At least, a link could be provided to component.add(popupmenu) method or a link to the tutorials in the same way as it is done for JPopupMenu.

            Unassigned Unassigned
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: