m.setVisible(true);
public void run() { db.setVisible(false); } });
public class Main extends JFrame{ private JPanel MainPanel; public static void main (String[] args){ //--main method --// Main window = new Main(); window.setVisible(true); } private Main(){ //--constructor --// MainPanel = new JPanel(null); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getClassLoader().getResource("resources/cancelIcon.png"))); this.add(MainPanel); } }
ex.setVisible(true);
public void run() { Main f = new Main(); f.setVisible(true);
Main m = new Main(); m.setSize(600, 600); m.setVisible(true);
frame.setVisible(true); frame.addWindowListener(new WindowAdapter() { @Override
public class Main extends JFrame { public static void main(String[] args) { Main main = new Main(); main.setBackground(Color.WHITE); main.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); main.setSize(640, 480); Container contentPane = main.getContentPane(); ButtonRollover buttonRollover = new ButtonRollover("/bt_normal.png", "/bt_hover.png"); JButton btn = new JButton(); buttonRollover.apply(btn); contentPane.add(btn); main.setVisible(true); } }
a.setVisible(true);
public class Main extends JFrame { public static void main(String[] args) { Main main = new Main(); main.setBackground(Color.WHITE); main.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); main.setSize(640, 480); Container contentPane = main.getContentPane(); ButtonRollover buttonRollover = new ButtonRollover("/bt_normal.png", "/bt_hover.png"); JButton btn = new JButton(); buttonRollover.apply(btn); contentPane.add(btn); main.setVisible(true); } }
private Main doDebug(ContextFactory contextFactory, NodeJsGlobal global) { final Main main = new Main("Rhino JavaScript Debugger"); main.attachTo(contextFactory); main.setScope(global); main.pack(); main.setSize(DEBUG_WINDOW_WIDTH, DEBUG_WINDOW_HEIGHT); main.setVisible(true); return main; }
static synchronized Main getDebugger() { if (debugger == null) { final Main db = new Main("Cocoon Flow Debugger"); db.pack(); Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); size.width *= 0.75; size.height *= 0.75; db.setSize(size.width, size.height); db.setExitAction(new Runnable() { public void run() { db.setVisible(false); } }); db.setOptimizationLevel(OPTIMIZATION_LEVEL); db.setVisible(true); debugger = db; ContextFactory.getGlobal().addListener(debugger); } return debugger; }
/** * Main entry point. Creates a debugger attached to a Rhino * {@link org.mozilla.javascript.tools.shell.Main} shell session. */ public static void main(String[] args) { Main main = new Main("Rhino JavaScript Debugger"); main.doBreak(); main.setExitAction(new IProxy(IProxy.EXIT_ACTION)); System.setIn(main.getIn()); System.setOut(main.getOut()); System.setErr(main.getErr()); Global global = org.mozilla.javascript.tools.shell.Main.getGlobal(); global.setIn(main.getIn()); global.setOut(main.getOut()); global.setErr(main.getErr()); main.attachTo( org.mozilla.javascript.tools.shell.Main.shellContextFactory); main.setScope(global); main.pack(); main.setSize(600, 460); main.setVisible(true); org.mozilla.javascript.tools.shell.Main.exec(args); }
/** * Main entry point. Creates a debugger attached to a Rhino * {@link org.mozilla.javascript.tools.shell.Main} shell session. */ public static void main(String[] args) { Main main = new Main("Rhino JavaScript Debugger"); main.doBreak(); main.setExitAction(new IProxy(IProxy.EXIT_ACTION)); System.setIn(main.getIn()); System.setOut(main.getOut()); System.setErr(main.getErr()); Global global = org.mozilla.javascript.tools.shell.Main.getGlobal(); global.setIn(main.getIn()); global.setOut(main.getOut()); global.setErr(main.getErr()); main.attachTo( org.mozilla.javascript.tools.shell.Main.shellContextFactory); main.setScope(global); main.pack(); main.setSize(600, 460); main.setVisible(true); org.mozilla.javascript.tools.shell.Main.exec(args); }
/** * Main entry point. Creates a debugger attached to a Rhino * {@link org.mozilla.javascript.tools.shell.Main} shell session. */ public static void main(String[] args) { Main main = new Main("Rhino JavaScript Debugger"); main.doBreak(); main.setExitAction(new IProxy(IProxy.EXIT_ACTION)); System.setIn(main.getIn()); System.setOut(main.getOut()); System.setErr(main.getErr()); Global global = org.mozilla.javascript.tools.shell.Main.getGlobal(); global.setIn(main.getIn()); global.setOut(main.getOut()); global.setErr(main.getErr()); main.attachTo( org.mozilla.javascript.tools.shell.Main.shellContextFactory); main.setScope(global); main.pack(); main.setSize(600, 460); main.setVisible(true); org.mozilla.javascript.tools.shell.Main.exec(args); }
getDebugger().setVisible(true);
getDebugger().setVisible(true);
/** * Helper method for {@link #mainEmbedded(String)}, etc. */ private static Main mainEmbeddedImpl(ContextFactory factory, Object scopeProvider, String title) { if (title == null) { title = "Rhino JavaScript Debugger (embedded usage)"; } Main main = new Main(title); main.doBreak(); main.setExitAction(new IProxy(IProxy.EXIT_ACTION)); main.attachTo(factory); if (scopeProvider instanceof ScopeProvider) { main.setScopeProvider((ScopeProvider)scopeProvider); } else { Scriptable scope = (Scriptable)scopeProvider; if (scope instanceof Global) { Global global = (Global)scope; global.setIn(main.getIn()); global.setOut(main.getOut()); global.setErr(main.getErr()); } main.setScope(scope); } main.pack(); main.setSize(600, 460); main.setVisible(true); return main; }
/** * Helper method for {@link #mainEmbedded(String)}, etc. */ private static Main mainEmbeddedImpl(ContextFactory factory, Object scopeProvider, String title) { if (title == null) { title = "Rhino JavaScript Debugger (embedded usage)"; } Main main = new Main(title); main.doBreak(); main.setExitAction(new IProxy(IProxy.EXIT_ACTION)); main.attachTo(factory); if (scopeProvider instanceof ScopeProvider) { main.setScopeProvider((ScopeProvider)scopeProvider); } else { Scriptable scope = (Scriptable)scopeProvider; if (scope instanceof Global) { Global global = (Global)scope; global.setIn(main.getIn()); global.setOut(main.getOut()); global.setErr(main.getErr()); } main.setScope(scope); } main.pack(); main.setSize(600, 460); main.setVisible(true); return main; }
/** * Helper method for {@link #mainEmbedded(String)}, etc. */ private static Dim mainEmbeddedImpl(ContextFactory factory, Object scopeProvider, String title) { if (title == null) { title = "Rhino JavaScript Debugger (embedded usage)"; } Main main = new Main(title); main.doBreak(); main.setExitAction(new IProxy(IProxy.EXIT_ACTION)); main.attachTo(factory); if (scopeProvider instanceof ScopeProvider) { main.setScopeProvider((ScopeProvider)scopeProvider); } else { Scriptable scope = (Scriptable)scopeProvider; if (scope instanceof Global) { Global global = (Global)scope; global.setIn(main.getIn()); global.setOut(main.getOut()); global.setErr(main.getErr()); } main.setScope(scope); } main.pack(); main.setSize(600, 460); main.setVisible(true); return main.dim; }