    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import java.awt.Canvas;
    006    import net.minecraft.client.MinecraftApplet;
    007
    008    @SideOnly(Side.CLIENT)
    009    public class CanvasMinecraftApplet extends Canvas
    010    {
    011        /** Reference to the MinecraftApplet object. */
    012        final MinecraftApplet mcApplet;
    013
    014        public CanvasMinecraftApplet(MinecraftApplet par1MinecraftApplet)
    015        {
    016            this.mcApplet = par1MinecraftApplet;
    017        }
    018
    019        public synchronized void addNotify()
    020        {
    021            super.addNotify();
    022            this.mcApplet.startMainThread();
    023        }
    024
    025        public synchronized void removeNotify()
    026        {
    027            this.mcApplet.shutdown();
    028            super.removeNotify();
    029        }
    030    }