(Apple Problem ID# 2692492)
To reproduce this problem, click on the "Report frame location" button in the applet below. Using MRJ 2.2.4 for Macintosh OS 9 and Internet Explorer 5.0, no matter where the frame is moved the report stays at the original location (100, 100). This is not a problem with repainting the display, as shown by the same information appearing in the Java Messages.
Everything works fine with the OS 9 Applet Runner, on Windows and in MRJ for OS X. This bug creates a problem for positioning components such a ToolTips on a Frame in OS 9.
If you have any insights, workarounds or comments about this test page please contact Mickey Segal. A listing of many Macintosh Java bugs with demonstration applets is at this link, including information on how to add any necessary Java plugins.
The source code is shown below and can be downloaded from this link.
import java.applet.*;
import java.awt.*;
public class FrameLocation extends Applet {
Frame frame;
Button button;
public void init()
{
button = new Button("Report frame location");
add(button);
frame = new Frame("A frame");
frame.reshape(100, 100, 300, 300);
frame.validate();
frame.show();
}
public void paint(Graphics g)
{
g.drawString("Frame x = " + frame.location().x, 10 , 100);
g.drawString("Frame y = " + frame.location().y, 10 , 125);
}
public final boolean action(Event evt, Object obj)
{
if (evt.target == button)
{
System.out.println("Frame x = " + frame.location().x);
System.out.println("Frame y = " + frame.location().y);
repaint();
}
return super.action(evt, obj);
}
} // END OF Class FrameLocation