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

under jdk1.3.1, when a new JFrame is launched, it will jump from one place to an

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2 P2
    • None
    • 1.3.1
    • client-libs
    • sparc
    • solaris_8

      Compile and run the following codes under jdk1.3.1, you will find that the new created frame will move automatically, but under jdk1.2 and jdk1.4, the codes work well.

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

      public class Test {
          public Test() {
              JFrame f = new JFrame("Test JFrame");
      JPanel p = new JPanel(new FlowLayout());
      JButton btn = new JButton("New Frame");
      btn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
      JFrame newFrame = new JFrame("popup frame");
      JPanel pp = new JPanel();
      pp.setPreferredSize(new Dimension(300, 400));
      newFrame.setContentPane(pp);
      newFrame.pack();
      newFrame.setVisible(true);
      }
      });
      p.add(btn);
      f.setContentPane(p);
      f.pack();
      f.setVisible(true);
          }

          public static void main(String[] args) {
              new Test();
          }
      }

      following is the java version info:

      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)

            rraysunw Richard Ray (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: