package NET.worlds.console; import NET.worlds.core.IniFile; public class AdBanner { private WebControl wc = null; public AdBanner(int width, int height, String url) { if (IniFile.gamma().getIniInt("NoAdBanners", 0) != 1) { Console c = Console.getActive(); if (c != null && c instanceof DefaultConsole) { DefaultConsole dc = (DefaultConsole)c; try { RenderCanvas canvas = dc.getRender(); if (canvas == null) { return; } this.wc = new WebControl(canvas, width, height, false, true, true); this.wc.activate(); this.wc.setURL(url); } catch (NoWebControlException var7) { System.out.println("Error creating IE control; " + var7.toString()); } } } } public void detach() { if (this.wc != null) { this.wc.detach(); } this.wc = null; } }