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

Regression: setFocusAccelerator() in JTextComponent is not working in Kestrel

XMLWordPrintable

    • rc2
    • x86, sparc
    • solaris_7, windows_nt
    • Verified



        Name: skT88420 Date: 02/03/2000


        java version "1.3.0rc1"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-T)
        Java HotSpot(TM) Client VM (build 1.3.0rc1-S, mixed mode)

        Every time the first component you added a FocusAccelerator gets the focus. In
        the following example always t1 gets the focus when you press "ALT+A" or "ALT+B"

        import javax.swing.*;
        import java.awt.*;
        import javax.swing.event.*;

        public class test extends JFrame
        {
            public test()
            {
                super();
                this.getContentPane().setLayout(new FlowLayout());
                this.setBounds(50, 50, 200, 300);
                this.setVisible(true);
            }

            public static void main(String st[])
            {
                test frame = new test();
                frame.getContentPane().add(new JButton("Press"));
                JTextField t1=new JTextField("123");
                t1.setFocusAccelerator('A');
                frame.getContentPane().add(t1);
                JTextField t2=new JTextField("ABC");
                t2.setFocusAccelerator('B');
                frame.getContentPane().add(t2);
            }
        }

        That is a really bad problem because we need this functionallity in our
        "Centralized Booking"-Department and we have already distributed the new JRE in
        our whole company...
        (Review ID: 100737)
        ======================================================================

              svioletsunw Scott Violet (Inactive)
              skonchad Sandeep Konchady
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: