Example usage for javax.swing JApplet init

List of usage examples for javax.swing JApplet init

Introduction

In this page you can find the example usage for javax.swing JApplet init.

Prototype

public void init() 

Source Link

Document

Called by the browser or applet viewer to inform this applet that it has been loaded into the system.

Usage

From source file:Composite.java

public static void main(String s[]) {
    JFrame f = new JFrame("Composite");
    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);//from  w w  w. j  a  v  a 2 s. com
        }
    });
    JApplet applet = new Composite();
    f.getContentPane().add("Center", applet);
    applet.init();
    f.pack();
    f.setSize(new Dimension(300, 300));
    f.setVisible(true);
}

From source file:SampleTableModel.java

public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {

        @Override//from w  w w . ja va  2 s  .com
        public void run() {
            try {
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
            } catch (Exception e) {
            }

            JFrame frame = new JFrame("Swing JTable");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

            JApplet applet = new SwingInterop();
            applet.init();

            frame.setContentPane(applet.getContentPane());

            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);

            //               applet.start();
        }
    });
}

From source file:Box2.java

public static void run(JApplet applet, int width, int height) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(applet);/*from w w w  .j  a  va2 s  . c  om*/
    frame.setSize(width, height);
    applet.init();
    applet.start();
    frame.setVisible(true);
}

From source file:gui.accessories.BattleSimFx.java

@Override
public void start() {
    SwingUtilities.invokeLater(new Runnable() {

        @Override//w  w w . j  a v a  2 s . c  o m
        public void run() {
            JFrame frame = new JFrame("Swing JTable");
            frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);

            JApplet applet = new BattleSimFx();
            applet.init();

            frame.setContentPane(applet.getContentPane());

            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);

            //               applet.start();
        }
    });
}