-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.0.2
-
x86
-
windows_95
The program below when run displays 2 windows stacked one on top of each other.
When the button in one is pressed the other is raised to the top of te window
stack.
This works fine under Solaris 2.5.1 withJ DK 1.0.2, but fails under Windows '95
with JDK1.0.2
The "other" window is raised rather than the one being clicked on since, otherwise
Windows '95 default behaviour of raising a window that gets focus masks the
problem. This is most likely related to the bug.
import java.awt.*;
import java.applet.*;
import java.io.*;
public class winstackFrame extends Frame {
winstackFrame win=null;
public static void main(String args[]) {
winstackFrame w1 = new winstackFrame("Frame 1");
winstackFrame w2 = new winstackFrame("Frame 2");
w1.raiseWin(w2);
w2.raiseWin(w1);
}
void raiseWin(winstackFrame f) {
win = f;
}
public winstackFrame (String s) {
super(s);
Panel p1 = new Panel();
Button b1 = new Button("Raise Frame");
p1.add(b1);
add("Center",p1);
reshape(100,100,200,100);
show();
}
public synchronized boolean action(Event e, Object o) {
if (e.target instanceof Button) {
System.out.println("raising window");
if ((win != null) && (win instanceof Frame)) {
win.toFront();
return true;
}
}
return false;
}
}
When the button in one is pressed the other is raised to the top of te window
stack.
This works fine under Solaris 2.5.1 withJ DK 1.0.2, but fails under Windows '95
with JDK1.0.2
The "other" window is raised rather than the one being clicked on since, otherwise
Windows '95 default behaviour of raising a window that gets focus masks the
problem. This is most likely related to the bug.
import java.awt.*;
import java.applet.*;
import java.io.*;
public class winstackFrame extends Frame {
winstackFrame win=null;
public static void main(String args[]) {
winstackFrame w1 = new winstackFrame("Frame 1");
winstackFrame w2 = new winstackFrame("Frame 2");
w1.raiseWin(w2);
w2.raiseWin(w1);
}
void raiseWin(winstackFrame f) {
win = f;
}
public winstackFrame (String s) {
super(s);
Panel p1 = new Panel();
Button b1 = new Button("Raise Frame");
p1.add(b1);
add("Center",p1);
reshape(100,100,200,100);
show();
}
public synchronized boolean action(Event e, Object o) {
if (e.target instanceof Button) {
System.out.println("raising window");
if ((win != null) && (win instanceof Frame)) {
win.toFront();
return true;
}
}
return false;
}
}