Strange menubar graphic artifact in frames created by applets

Discussion in 'Java' started by Felix Dejavu, Nov 21, 2003.

  1. Felix Dejavu

    Felix Dejavu Guest

    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();
    }
    }
     
    Felix Dejavu, Nov 21, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dev_Prog
    Replies:
    3
    Views:
    310
    Dev_Prog
    Mar 6, 2004
  2. Jerry Henderson
    Replies:
    0
    Views:
    809
    Jerry Henderson
    Sep 1, 2004
  3. Roedy Green

    Artifact free scrolling

    Roedy Green, Jul 13, 2005, in forum: Java
    Replies:
    0
    Views:
    361
    Roedy Green
    Jul 13, 2005
  4. Matthew
    Replies:
    0
    Views:
    112
    Matthew
    Dec 27, 2003
  5. Simeon Chaos
    Replies:
    5
    Views:
    150
    James Harris
    Jan 11, 2014
Loading...

Share This Page