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

Regression Dialog doesn't comes in focus(on top of all window).

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 6
    • 6
    • client-libs
    • x86
    • windows_nt

      Name: ddT132432 Date: 09/26/2001


      java version "1.3.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
      Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

      Dialog doesn't come to focus(come to top of all window) when there is no frame
      associated with it.

      Steps on how to reproduce the bug.
      1) Start the following program given in Dos Prompt and IMMEDIATELY select
      another application say NotePad by alt-tab or clicking an application in task
      Bar of Windows NT Operating system.
      2) The given program pops up a dialog every 4 sec so if step 1 is done
      then for the FIRST time the dialog does not come into focus or in other words
      on top of all windows in the operating system.
      3) But if I don't select any application as in step 1 then the dialog comes on
      top with focus.

      I have requirement in which the dialog box is to be poped asynchronously and it
      should come on TOP of all window.

      For Some reason this code does not work under JDK1.4beta2 but only on the JDK
      1.3.X JDKs. This may be a Regression bug.

      //Test Case
      import javax.swing.*;
      import java.awt.event.*;

      public class TestForFocus extends JFrame implements ActionListener
      {
      public TestForFocus()
      {
      //4 sec delay.
      Timer timer = new Timer(4000,this);
      timer.setRepeats(true);
      timer.start();
      }

      public void actionPerformed(ActionEvent actionEvent)
      {
      JOptionPane.showMessageDialog(null,"Test for focus on this dialog");
      }

      public static void main(String arg[])
      {
      TestForFocus testForFocus = new TestForFocus();
      }
      }
      (Review ID: 132622)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: