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

window.toFront() does not work when called from windowActivated()

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description


      ingrid.yao@Eng 1997-07-30

      If Window.toFront() is called in WindowListener.windowActivated() to activate
      a different window, the other window is brought to the top but is not activated.

      From the test case included below, shouldn't be able to activate Frame 1.
      When Frame 1 is activated, toFront() is called on Frame 2, which should
      activate Frame 2 and bring it to the top.

      test case:
      ===========================================================================
      import java.applet.*;
      import java.awt.*;
      import java.awt.event.*;
      public class ToFront
             extends Applet
             implements WindowListener
      {
         private Frame _mFrame1;
         private Frame _mFrame2;

         public ToFront()
         {
         }

         public void start ()
         {

            _mFrame1 = new Frame("frame 1");
            _mFrame2 = new Frame("frame 2");
            _mFrame1.setBounds(100, 100, 300, 200);
            _mFrame1.setBounds(125, 125, 300, 200);

            _mFrame1.setVisible(true);
            _mFrame2.setVisible(true);

            _mFrame1.addWindowListener(this);
            _mFrame2.addWindowListener(this);
         }
         public void windowOpened(WindowEvent e)
         {
         }
         public void windowClosing(WindowEvent e)
         {
         }
         public void windowClosed(WindowEvent e)
         {
         }
         public void windowIconified(WindowEvent e)
         {
         }
         public void windowDeiconified(WindowEvent e)
         {
         }
         public void windowActivated(WindowEvent e)
         {
            System.out.println("windowActivated " + e.getSource());
            if (_mFrame1 == e.getSource())
            {
               _mFrame2.toFront();
            }
         }
         public void windowDeactivated(WindowEvent e)
         {
         }
      }

      ingrid.yao@Eng 1997-11-25

      This problem still can be reproduced on Solaris 2.5.1 platform for JDK1.1.5J build.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: