Package com.github.couchapptakeout.ui

Examples of com.github.couchapptakeout.ui.EmbeddedBrowser





    private void showEmbedded(String applicationUrl) {
        final EmbeddedBrowser browser = new EmbeddedBrowser();
        browser.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                int value = JOptionPane.showConfirmDialog(browser, "Are you sure you want to exit?", appName, JOptionPane.YES_NO_OPTION);
                if (value == JOptionPane.YES_OPTION) {
                    browser.dispose();
                    EventBus.publish(new ExitApplicationMessage() );
                }
            }
        });

        browser.setVisible(true);
        if (appIcon != null) browser.setIconImage(appIcon.getImage());
        browser.setTitle(appName);

        browser.setExtendedState(JFrame.MAXIMIZED_BOTH);
        try {
            // have some delay before showing? Maybe not init'ed
            Thread.sleep(400);
        } catch (InterruptedException ex) {
            Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
        }

        browser.setUrl(applicationUrl);
        browser.invalidate();
        browser.validate();
        browser.repaint();
    }
View Full Code Here

TOP

Related Classes of com.github.couchapptakeout.ui.EmbeddedBrowser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.