java.applet.Applet.init()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(231)

本文整理了Java中java.applet.Applet.init()方法的一些代码示例,展示了Applet.init()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Applet.init()方法的具体详情如下:
包路径:java.applet.Applet
类名称:Applet
方法名:init

Applet.init介绍

暂无

代码示例

代码示例来源:origin: runelite/runelite

  1. public ClientPanel(@Nullable Applet client)
  2. {
  3. setSize(Constants.GAME_FIXED_SIZE);
  4. setMinimumSize(Constants.GAME_FIXED_SIZE);
  5. setPreferredSize(Constants.GAME_FIXED_SIZE);
  6. setLayout(new BorderLayout());
  7. setBackground(Color.black);
  8. if (client == null)
  9. {
  10. return;
  11. }
  12. client.setLayout(null);
  13. client.setSize(Constants.GAME_FIXED_SIZE);
  14. client.init();
  15. client.start();
  16. add(client, BorderLayout.CENTER);
  17. // This causes the whole game frame to be redrawn each frame instead
  18. // of only the viewport, so we can hook to MainBufferProvider#draw
  19. // and draw anywhere without it leaving artifacts
  20. if (client instanceof Client)
  21. {
  22. ((Client)client).setGameDrawingMode(2);
  23. }
  24. }
  25. }

代码示例来源:origin: ATLauncher/ATLauncher

  1. @Override
  2. public void init() {
  3. if (wrappedApplet != null) {
  4. wrappedApplet.init();
  5. }
  6. }

代码示例来源:origin: net.sourceforge.plantuml/plantuml

  1. @Override
  2. public void init() {
  3. super.init();
  4. }

代码示例来源:origin: Spoutcraft/LegacyLauncher

  1. @Override
  2. public void init() {
  3. if (minecraftApplet != null) {
  4. minecraftApplet.init();
  5. }
  6. }

代码示例来源:origin: joel-costigliola/assertj-swing

  1. private void loadApplet() {
  2. applet.init();
  3. applet.start();
  4. loaded = true;
  5. }

代码示例来源:origin: stackoverflow.com

  1. Class applet2 = Class.forName("Applet2");
  2. Applet appletToLoad = (Applet)applet2.newInstance();
  3. appletToLoad.setStub(this);
  4. setLayout(new GridLayout(1,0));
  5. add(appletToLoad);
  6. appletToLoad.init();
  7. appletToLoad.start();

代码示例来源:origin: stackoverflow.com

  1. if (strp.matches(strp) && stru.matches(stru))
  2. {
  3. Class applet2 = Class.forName("register"); // give complete name of register class including package name
  4. Applet appletToLoad = (Applet)applet2.newInstance();
  5. appletToLoad.setStub(this);
  6. setLayout( new GridLayout(1,0));
  7. add(appletToLoad);
  8. appletToLoad.init();
  9. appletToLoad.start();
  10. }
  11. else
  12. {
  13. JOptionPane.showMessageDialog(null,"User name or password are not correct.");
  14. return;
  15. }

代码示例来源:origin: stackoverflow.com

  1. Applet applet = new TheRealApplet();
  2. applet.setStub(this);
  3. this.setLayout( new BorderLayout() );
  4. add( applet, BorderLayout.CENTER );
  5. applet.init();
  6. applet.start();

代码示例来源:origin: stackoverflow.com

  1. Applet applet = new CounterThread();
  2. applet.init();
  3. applet.start();

代码示例来源:origin: freehep/freehep-vectorgraphics

  1. public void init() {
  2. super.init();
  3. System.err.println("init");
  4. try {
  5. URL url = new URL("file:/Users/duns/svn/freehep/vectorgraphics/freehep-graphicsio-emf/TestOffset.emf");
  6. EMFInputStream is = new EMFInputStream(url.openStream());
  7. EMFRenderer renderer = new EMFRenderer(is);
  8. EMFPanel panel = new EMFPanel();
  9. panel.setRenderer(renderer);
  10. add(panel);
  11. } catch (MalformedURLException mfue) {
  12. System.err.println("URL Malformed "+mfue);
  13. } catch (IOException ioe) {
  14. System.err.println("IO Exception "+ioe);
  15. }
  16. }

代码示例来源:origin: stackoverflow.com

  1. import java.awt.*;
  2. import java.applet.Applet;
  3. import java.awt.geom.Rectangle2D;
  4. import javax.swing.*;
  5. public class Shapes extends JApplet {
  6. public static void main(String[] args) {
  7. JApplet app = new Shapes();
  8. JFrame f = new JFrame("Example");
  9. f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  10. app.init();
  11. app.start();
  12. f.add("Center", app);
  13. f.pack();
  14. f.setVisible(true);
  15. }
  16. Shapes() {
  17. }
  18. public void paint(Graphics g) {
  19. Graphics2D g2d = (Graphics2D) g;
  20. g2d.drawLine(20, 20, 100, 100);
  21. }
  22. }

代码示例来源:origin: stackoverflow.com

  1. AppletStub stub = new AppletStub() {
  2. // lots of code including defining the parameter 'myParameter'
  3. };
  4. Applet a = new Applet();
  5. a.setStub(stub);
  6. a.init();
  7. // ...

代码示例来源:origin: stackoverflow.com

  1. import javax.swing.JFrame;
  2. import javax.swing.JApplet;
  3. class TLAppletFrame {
  4. public static void main(String[] args) {
  5. JApplet applet = new TLApplet();
  6. applet.init();
  7. JFrame frame = new JFrame("Applet in Frame");
  8. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  9. frame.add( applet );
  10. frame.pack();
  11. frame.setLocationRelativeTo( null );
  12. frame.setVisible( true );
  13. applet.start();
  14. }
  15. }

代码示例来源:origin: mikera/tyrant

  1. public void init(Runnable runnable) {
  2. // recreate lib in background
  3. setInstance(this);
  4. Game.setQuestapp(this);
  5. super.init();
  6. setLayout(new BorderLayout());
  7. setBackground(Color.black);
  8. setFont(mainfont);
  9. // Game.warn("Focus owned by:
  10. // "+KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
  11. // set game in action
  12. Game.setUserinterface(new Interface());
  13. Game.thread = new Thread(runnable);
  14. Game.thread.start();
  15. }

代码示例来源:origin: ATLauncher/ATLauncher

  1. public void replace(Applet applet) {
  2. this.wrappedApplet = applet;
  3. applet.setStub(this);
  4. applet.setSize(getWidth(), getHeight());
  5. this.setLayout(new BorderLayout());
  6. this.add(applet, "Center");
  7. applet.init();
  8. active = true;
  9. applet.start();
  10. validate();
  11. }

代码示例来源:origin: KokaKiwi/MCLauncher

  1. public void replace(Applet applet)
  2. {
  3. this.applet = applet;
  4. applet.setStub(this);
  5. applet.setSize(getWidth(), getHeight());
  6. setLayout(new BorderLayout());
  7. add(applet, "Center");
  8. applet.init();
  9. active = true;
  10. applet.start();
  11. validate();
  12. }

代码示例来源:origin: org.scijava/j3dutils

  1. @Override
  2. public void run() {
  3. showStatus( name + " initializing..." );
  4. applet.init();
  5. validate();
  6. showStatus( name + " starting..." );
  7. applet.start();
  8. validate();
  9. showStatus( name + " running..." );
  10. }

代码示例来源:origin: tomsik68/mclauncher-api

  1. public void replace(Applet applet) {
  2. this.minecraft = applet;
  3. applet.setStub(this);
  4. applet.setSize(getWidth(), getHeight());
  5. setLayout(new BorderLayout());
  6. add(applet, "Center");
  7. applet.init();
  8. this.active = true;
  9. applet.start();
  10. validate();
  11. }

代码示例来源:origin: org.scijava/j3dutils

  1. @Override
  2. public void run() {
  3. showStatus( name + " initializing..." );
  4. applet.init();
  5. validate();
  6. showStatus( name + " starting..." );
  7. applet.start();
  8. validate();
  9. showStatus( name + " running..." );
  10. }

代码示例来源:origin: davidsoergel/jlibsvm

  1. AppletFrame(String title, Applet applet, int width, int height)
  2. {
  3. super(title);
  4. this.addWindowListener(new WindowAdapter()
  5. {
  6. public void windowClosing(WindowEvent e)
  7. {
  8. System.exit(0);
  9. }
  10. });
  11. applet.init();
  12. applet.setSize(width, height);
  13. applet.start();
  14. this.add(applet);
  15. this.pack();
  16. this.setVisible(true);
  17. }
  18. }

相关文章