Strange menubar graphic artifact in frames created by applets

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();
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top