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

JTextField looks like it has keyboard focus but doesn't

    Details

    • Subcomponent:
    • CPU:
      x86, sparc
    • OS:
      solaris_7, windows_nt

      Description



      Name: rk38400 Date: 04/13/98


      run the following program. Notice that the first
      JTextField has a cursor blinking but you cannot type in it.
      If you hit the TAB key or click in the first JTextField, then
      it will really have focus.
      This seems to only happen when in a JApplet.

      I'm using NT/JDK1.1.5/Swing1.0

      ----CUT HERE------------
      import java.awt.*;
      import com.sun.java.swing.*;

      public class FakeFocus extends com.sun.java.swing.JApplet {

      public void init() {

      getContentPane().setLayout(new FlowLayout());
      JTextField b1 = new JTextField(20);
      JTextField b2 = new JTextField(20);
      JTextField b3 = new JTextField(20);
      getContentPane().add(b1);
      //add(b1);
      //add(b2);
      getContentPane().add(b2);
      getContentPane().add(b3);
      //add(b3);
      }

      public static void main(String argv[]) {

      JFrame frame = new JFrame();
      FakeFocus app = new FakeFocus();
      app.init();
      frame.getContentPane().add(app);
      frame.pack();
      frame.show();
      }
      }
      ------END-----------------
      (Review ID: 26888)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kdmsunw Kdm Kdm (Inactive)
                Reporter:
                rkarsunw Ralph Kar (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: