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

CheckboxMenuItem.setState() doesnt work.

    XMLWordPrintable

Details

    • 1.0.2
    • sparc
    • generic, solaris_2.4
    • Not verified

    Description

      CheckboxMenuItem.setState(boolean) doesnt show the set state in the Menu
      though it does register the state internally. To reproduce this, run the
      CheckboxMenuItemTest.java test case. Clip Dump Status button once the
      applet is loaded. Notice that the second and third menuitems are supposed
      to be true but the menuitems dont show that.

      Vijay

      The description field as copied from bug report 1243857 follows:

      The first time the CheckboxMenuItem comes up, it always shows as "unchecked"
      even the setState(true) call has been made.

      This only happens on Solaris.

      Since the CheckboxMenuItem constructor does not have a argument for setting the
      initial state, the code in JDK/src/solaris/sun/awt_MenuItem.c always set it to false(unchecked):

              if (unhand(this)->isCheckbox != 0) {
                  XtSetArg(args[argc], XmNset, False); argc++;
                  XtSetArg(args[argc], XmNvisibleWhenOff, True); argc++;
                  mdata->comp.widget = XmCreateToggleButton(menuData->itemData.comp.widget,
                                                            clabel,
                                                            args,
                                                            argc);

      Attachments

        Issue Links

          Activity

            People

              duke J. Duke
              vssriniv Vijay Srinivasan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: