F
Felix Dejavu
When I create a frame from an applet and add a menubar, a strange thing
happens. When the frame is enlarged, the menubar will be drawn correctly
over the preexisting area, but the newly created/exposed area of the
menubar will remain undrawn and will usually contain whatever was there
before the window was widened (other windows, etc.). When I open the same
frame when I'm not an applet, the menubar is fine. I'm using Win98 with
the latest JRE. It occurs both in explorer and in appletviewer. Is this a
known problem or am I smoking the crack?
-fd
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
class MenuFrame extends Frame {
public MenuFrame() {
Menu m = new Menu("File");
m.add("Exit");
MenuBar mb = new MenuBar();
mb.add(m);
setMenuBar(mb);
addWindowListener(new WindowHandler());
setSize(200, 100);
setVisible(true);
}
class WindowHandler extends WindowAdapter {
public void windowClosing(WindowEvent ev) {
dispose();
}
}
}
public class MenuProblem extends Applet {
public void start() {
new MenuFrame();
}
static public void main(String[] args) {
new MenuProblem().start();
}
}
happens. When the frame is enlarged, the menubar will be drawn correctly
over the preexisting area, but the newly created/exposed area of the
menubar will remain undrawn and will usually contain whatever was there
before the window was widened (other windows, etc.). When I open the same
frame when I'm not an applet, the menubar is fine. I'm using Win98 with
the latest JRE. It occurs both in explorer and in appletviewer. Is this a
known problem or am I smoking the crack?
-fd
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
class MenuFrame extends Frame {
public MenuFrame() {
Menu m = new Menu("File");
m.add("Exit");
MenuBar mb = new MenuBar();
mb.add(m);
setMenuBar(mb);
addWindowListener(new WindowHandler());
setSize(200, 100);
setVisible(true);
}
class WindowHandler extends WindowAdapter {
public void windowClosing(WindowEvent ev) {
dispose();
}
}
}
public class MenuProblem extends Applet {
public void start() {
new MenuFrame();
}
static public void main(String[] args) {
new MenuProblem().start();
}
}