Choice does not take focus

XMLWordPrintable

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: P2
    • None
    • Affects Version/s: 1.0.2, 1.1
    • Component/s: client-libs
    • None
    • sparc
    • solaris_2.5, solaris_2.5.1

      JDK 1.1/Solaris Motif

      The following program demonstrates a JDK1.1/Solaris Motif problem with Choice boxes and tab naviagation. When attempting to tab from the TextField into the Choice box, the Choice does not take focus, although FocusManager.assignFocus() and peer.requestFocus() are called.

      import java.awt.*;
      import java.applet.*;

      public class Test extends Applet {
          public void init() {
              add(new TextField("ABC", 30));

      Choice c = new Choice();
      c.addItem("choice 1");
      c.addItem("choice 2");
      c.addItem("choice 3");
      add(c);

              add(new TextField("DEF", 30));

      add(new Button("OK"));
          }
      }

      Output with added print statements:
      -----------------------------------
      % java sun.applet.AppletViewer Test.html
      FocusManager.focusNext: base=java.awt.TextField[textfield0,125,5,260x29,text=ABC,editable,selection=3-3]
      FocusManager.assignFocus: java.awt.Choice[choice0,390,6,82x27,current=choice 1]
      peer.requestFocus()
      FocusManager.focusNext: base=java.awt.TextField[textfield1,477,5,260x29,text=DEF,editable,selection=3-3]
      FocusManager.assignFocus: java.awt.Button[button0,742,8,32x22,label=OK]
      peer.requestFocus()

            Assignee:
            Creighton Chong (Inactive)
            Reporter:
            J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: