当前位置: 首页>>代码示例>>Java>>正文


Java JApplet.init方法代码示例

本文整理汇总了Java中javax.swing.JApplet.init方法的典型用法代码示例。如果您正苦于以下问题:Java JApplet.init方法的具体用法?Java JApplet.init怎么用?Java JApplet.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JApplet的用法示例。


在下文中一共展示了JApplet.init方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import javax.swing.JApplet; //导入方法依赖的package包/类
public void run() {

   try {
      Class cls = Class.forName(loadAppletName);
      JApplet app = (JApplet)cls.newInstance();
      app.setStub((AppletStub)this);
      app.init();
      
     
      getContentPane().add("Center", app);
      loadApplet = app;
      validate();
     
      if(isStarted) {
     	 loadApplet.start();
      }
      validate();
   } catch (Throwable e) {
  	 loadApplet = null;
      AppletLogger.showError("Exception:", e);
      
      e.printStackTrace();
      validate();
   }
   System.out.println("Thread end");
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:27,代码来源:AppletLaunch.java

示例2: run

import javax.swing.JApplet; //导入方法依赖的package包/类
public void run() {

   try {
      Class cls = Class.forName(loadAppletName);
      JApplet app = (JApplet)cls.newInstance();
      app.setStub((AppletStub)this);
      app.init();
      
     
      getContentPane().add("Center", app);
      loadApplet = app;
      validate();
     
      if(isStarted) {
     	 loadApplet.start();
      }
      validate();
   } catch (Throwable e) {
  	 loadApplet = null;
      AppletLogger.showError("Exception:", e);
      
      e.printStackTrace();
      validate();
   }
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:26,代码来源:AppletLaunch.java

示例3: main

import javax.swing.JApplet; //导入方法依赖的package包/类
/**
 * @param args
 * @throws IOException 
 */
public static void main(String[] args) throws IOException {
	// TODO Auto-generated method stub
	


      JFrame f = new JFrame("Line");
      f.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
            System.exit(0);
         }
      });
      
      JApplet applet = new Gynfont();
      f.getContentPane().add("Center", applet);
      applet.init();
      f.pack();
      f.setSize(new Dimension(800, 100));
      f.setVisible(true);
	
}
 
开发者ID:kmatylla,项目名称:gynvaels-fanclub,代码行数:25,代码来源:Gynfont.java

示例4: main

import javax.swing.JApplet; //导入方法依赖的package包/类
/**
 * @param args the command line arguments
 */
public static void main(String args[]) {
    JApplet applet = new DVSActApplet();
    JFrame frame = new ActivityMonitorTest(applet);
    applet.init();
    applet.start();
    frame.setVisible(true);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:11,代码来源:ActivityMonitorTest.java

示例5: main

import javax.swing.JApplet; //导入方法依赖的package包/类
/**
 * For testing in JFrame
 * @param args the command line arguments
 */
public static void main(String args[]) {
    JApplet applet = new ClockApplet();
    JFrame frame = new ActivityMonitorTest(applet);
    applet.init();
    applet.start();
    frame.setVisible(true);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:12,代码来源:ClockApplet.java

示例6: main

import javax.swing.JApplet; //导入方法依赖的package包/类
/**
 * For testing in JFrame
 * @param args the command line arguments
 */
public static void main(String args[]) {
    JApplet applet = new DVSActApplet();
    JFrame frame = new ActivityMonitorTest(applet);
    frame.setVisible(true);
    applet.init();
    applet.start();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:12,代码来源:DVSActApplet.java

示例7: initApplet

import javax.swing.JApplet; //导入方法依赖的package包/类
/**
 * Call this method to initialize an applet from your launcher class
 * <code>MyAppletLauncher.init()</code> method.
 *
 * @param sClass class name in form "MyClass" for default package
 * or "com.abc.MyClass" for class in some package
 *
 * @param appletParent parent applet from a launcher.
 *
 * @throws Throwable wrapper for many exceptions thrown while applet
 * instantiation and calling init() method.
 */
public void initApplet(String sClass, final JApplet appletParent) throws Throwable {
    Class<?> clazz = loadClass(sClass);
    logInfo(LogArea.CONFIG, "initApplet() --> %s.init(); Loader: %s", sClass, clazz.getClassLoader());
    applet = (JApplet)clazz.newInstance();
    applet.setStub(new AppletStub() {
        @Override
        public boolean isActive() {
            return appletParent.isActive();
        }
        @Override
        public URL getDocumentBase() {
            return appletParent.getDocumentBase();
        }
        @Override
        public URL getCodeBase() {
            return appletParent.getCodeBase();
        }
        @Override
        public String getParameter(String name) {
            return appletParent.getParameter(name);
        }
        @Override
        public AppletContext getAppletContext() {
            return appletParent.getAppletContext();
        }
        @Override
        public void appletResize(int width, int height) {
            appletParent.resize(width, height);
        }
    });
    applet.init();
    appletParent.setContentPane(applet.getContentPane());
}
 
开发者ID:Energyxxer,项目名称:Vanilla-Injection,代码行数:46,代码来源:JarClassLoader.java

示例8: run

import javax.swing.JApplet; //导入方法依赖的package包/类
public static void run(JApplet applet, int width, int height) {
	JFrame frame = new JFrame();
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.getContentPane().add(applet);
	frame.setSize(width, height);
	applet.init();
	applet.start();
	frame.setVisible(true);
}
 
开发者ID:iig-uni-freiburg,项目名称:SWAT20,代码行数:10,代码来源:Separation.java

示例9: initApplet

import javax.swing.JApplet; //导入方法依赖的package包/类
/**
 * Call this method to initialize an applet from your launcher class
 * <code>MyAppletLauncher.init()</code> method.
 *
 * @param sClass class name in form "MyClass" for default package or "com.abc.MyClass" for class
 *        in some package
 *
 * @param appletParent parent applet from a launcher.
 *
 * @throws Throwable wrapper for many exceptions thrown while applet instantiation and calling
 *         init() method.
 */
public void initApplet(String sClass, final JApplet appletParent) throws Throwable {
  Class<?> clazz = loadClass(sClass);
  logInfo(LogArea.CONFIG, "initApplet() --> %s.init(); Loader: %s", sClass,
      clazz.getClassLoader());
  applet = (JApplet) clazz.newInstance();
  applet.setStub(new AppletStub() {
    @Override
    public boolean isActive() {
      return appletParent.isActive();
    }

    @Override
    public URL getDocumentBase() {
      return appletParent.getDocumentBase();
    }

    @Override
    public URL getCodeBase() {
      return appletParent.getCodeBase();
    }

    @Override
    public String getParameter(String name) {
      return appletParent.getParameter(name);
    }

    @Override
    public AppletContext getAppletContext() {
      return appletParent.getAppletContext();
    }

    @Override
    public void appletResize(int width, int height) {
      appletParent.resize(width, height);
    }
  });
  applet.init();
  appletParent.setContentPane(applet.getContentPane());
}
 
开发者ID:Adrodoc55,项目名称:MPL,代码行数:52,代码来源:JarClassLoader.java

示例10: initApplet

import javax.swing.JApplet; //导入方法依赖的package包/类
/**
 * Call this method to initialize an applet from your launcher class 
 * <code>MyAppletLauncher.init()</code> method.
 * 
 * @param sClass class name in form "MyClass" for default package
 * or "com.abc.MyClass" for class in some package
 *
 * @param appletParent parent applet from a launcher.
 *
 * @throws Throwable wrapper for many exceptions thrown while applet 
 * instantiation and calling init() method.
 */
public void initApplet(String sClass, final JApplet appletParent) throws Throwable {
    Class<?> clazz = loadClass(sClass);
    logInfo(LogArea.CONFIG, "initApplet() --> %s.init(); Loader: %s", sClass, clazz.getClassLoader());
    applet = (JApplet)clazz.newInstance();
    applet.setStub(new AppletStub() {
        @Override
        public boolean isActive() {
            return appletParent.isActive();
        }
        @Override
        public URL getDocumentBase() {
            return appletParent.getDocumentBase();
        }
        @Override
        public URL getCodeBase() {
            return appletParent.getCodeBase();
        }
        @Override
        public String getParameter(String name) {
            return appletParent.getParameter(name);
        }
        @Override
        public AppletContext getAppletContext() {
            return appletParent.getAppletContext();
        }
        @Override
        public void appletResize(int width, int height) {
            appletParent.resize(width, height);
        }
    });
    applet.init();
    appletParent.setContentPane(applet.getContentPane());
}
 
开发者ID:open744,项目名称:terramaster,代码行数:46,代码来源:JarClassLoader.java

示例11: main

import javax.swing.JApplet; //导入方法依赖的package包/类
/**
 * Start this as a Java applet.
 * 
 * @param argv not used
 */
static public void main (String argv[]) {
    JApplet applet = new BlackScholesOptionCalculator();
    JFrame frame = new JFrame("BlackScholesOptionCalculator");			// create graphics frame
    frame.getContentPane().add(applet);									// add the applet
    frame.setSize(500,300);
    applet.init();														// initialise applet
    applet.start();
    frame.setVisible(true);
}
 
开发者ID:finmath,项目名称:finmath-experiments,代码行数:15,代码来源:BlackScholesOptionCalculator.java

示例12: main

import javax.swing.JApplet; //导入方法依赖的package包/类
/**
 * Run test applet.
 *
 * @param args command line parameters
 */
 public static void main(String[] args)
 {
     JApplet applet = new JApplet() {
         
private static final long serialVersionUID = 1L;

@Override
         public void init()
         {
             setLayout(new GridBagLayout());
             
             WheelswitchDemo wst = new WheelswitchDemo();
 
             GridBagConstraints consContent = new GridBagConstraints();
             consContent.gridx = 0;
             consContent.gridy = 1;
             consContent.gridwidth = 0;
             consContent.fill = java.awt.GridBagConstraints.BOTH;
             consContent.anchor = GridBagConstraints.CENTER;
             consContent.weightx = 1.0;
             consContent.weighty = 1.0;
             consContent.insets = new java.awt.Insets(11, 11, 11, 11);
             add(wst.initializeContentPanel(), consContent);

             ScrollPane helpTextScrollPane = new ScrollPane();
             helpTextScrollPane.add(wst.getHelpTextArea());
             
             GridBagConstraints consHelp = new GridBagConstraints();
             consHelp.gridx = 0;
             consHelp.gridy = 2;
             consHelp.gridwidth = 0;
             consHelp.fill = java.awt.GridBagConstraints.HORIZONTAL;
             consHelp.anchor = GridBagConstraints.CENTER;
             consHelp.weightx = 1.0;
             consHelp.weighty = 0.0;
             consHelp.insets = new java.awt.Insets(0, 11, 11, 11);
             add(helpTextScrollPane, consHelp);
         }
     };

     JFrame frame = new JFrame("Wheelswitch Testing Applet");
     frame.getContentPane().add(applet);
     frame.setSize(500, 400);
     frame.addWindowListener(new WindowAdapter() {
         @Override
         public void windowClosing(WindowEvent e)
         {
             System.exit(0);
         }
     });
     applet.init();
     applet.start();
     frame.setVisible(true);
 }
 
开发者ID:openxal,项目名称:openxal,代码行数:60,代码来源:WheelswitchDemo.java


注:本文中的javax.swing.JApplet.init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。