-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.2fcs
-
sparc
-
generic
-
Not verified
After a frame is show, remove() and add() a TextComponent or Canvas could cause
WINDOW_DEICONIFIED and WINDOW_ICONIFIED events so the frame will end up showing in ICONIFIED state.
import java.awt.*;
/*
* Run this test, the frame will be shown in ICONIFIED state
* because three Window Events were generated:
* WINDOW_ICONFIED
* WINDOW_DEICONFIED
* WINDOW_ICONFIED
* Deleting the last two lines, frame will show in normal state
*/
public class ExcessiveTest extends java.applet.Applet {
static TextField t = new TextField("Nothing is more fun");
public void init() {
add("North", new Button("Nothing is more fun"));
add("South", t);
// problem identified with three new components so far
// add("South", new TextArea("Nothing is more fun"));
// add("South", new TextField("Nothing is more fun"));
// add("South", new Canvas());
}
public static void main(String argv[]) {
ExcessiveTest a = new ExcessiveTest();
Frame f = new Frame("Test Frame");
f.add(a);
a.init();
a.start();
f.pack();
f.setVisible(true);
// comment out the following two lines, it shows as normal
a.remove(t);
a.add(t);
}
}
WINDOW_DEICONIFIED and WINDOW_ICONIFIED events so the frame will end up showing in ICONIFIED state.
import java.awt.*;
/*
* Run this test, the frame will be shown in ICONIFIED state
* because three Window Events were generated:
* WINDOW_ICONFIED
* WINDOW_DEICONFIED
* WINDOW_ICONFIED
* Deleting the last two lines, frame will show in normal state
*/
public class ExcessiveTest extends java.applet.Applet {
static TextField t = new TextField("Nothing is more fun");
public void init() {
add("North", new Button("Nothing is more fun"));
add("South", t);
// problem identified with three new components so far
// add("South", new TextArea("Nothing is more fun"));
// add("South", new TextField("Nothing is more fun"));
// add("South", new Canvas());
}
public static void main(String argv[]) {
ExcessiveTest a = new ExcessiveTest();
Frame f = new Frame("Test Frame");
f.add(a);
a.init();
a.start();
f.pack();
f.setVisible(true);
// comment out the following two lines, it shows as normal
a.remove(t);
a.add(t);
}
}