-
Bug
-
Resolution: Cannot Reproduce
-
P2
-
None
-
1.3.1
-
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)
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)