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

XAWT: Button in a Window doesn't get focus when the Window is shown

XMLWordPrintable

    • generic
    • linux

        The bug is reproducible on Tiger and Mustang with XAWT.

        To reproduce run the following test:

        1. A Frame with a button will appear, click the button.
        2. A Window (the Frame's owned) with a button will appear.

        ----------------------------------------
        import java.awt.*;
        import java.awt.event.*;

        public class WindowTest {

            public static void main(String[] args) {
                Frame f = new Frame();
                Button b = new Button("open window");
                f.add(b);
                f.pack();

                final Window w = new Window(f);
                w.add(new Button("button"));
                w.pack();

                b.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            w.setVisible(true);
                        }
                    });

                f.setVisible(true);
            }
        }
        ------------------------------------------

        If the button in the Window won't get focus, the bug is reproduced.




        ###@###.### 2005-07-05 13:26:47 GMT

              ant Anton Tarasov (Inactive)
              ant Anton Tarasov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: