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

public ClientPanel(@Nullable Applet client)
  {
    setSize(Constants.GAME_FIXED_SIZE);
    setMinimumSize(Constants.GAME_FIXED_SIZE);
    setPreferredSize(Constants.GAME_FIXED_SIZE);
    setLayout(new BorderLayout());
    setBackground(Color.black);

    if (client == null)
    {
      return;
    }

    client.setLayout(null);
    client.setSize(Constants.GAME_FIXED_SIZE);

    client.init();
    client.start();

    add(client, BorderLayout.CENTER);

    // This causes the whole game frame to be redrawn each frame instead
    // of only the viewport, so we can hook to MainBufferProvider#draw
    // and draw anywhere without it leaving artifacts
    if (client instanceof Client)
    {
      ((Client)client).setGameDrawingMode(2);
    }
  }
}

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

@Override
public void init() {
  if (wrappedApplet != null) {
    wrappedApplet.init();
  }
}

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

@Override
public void init() {
  super.init();
}

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

@Override
public void init() {
  if (minecraftApplet != null) {
    minecraftApplet.init();
  }
}

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

private void loadApplet() {
 applet.init();
 applet.start();
 loaded = true;
}

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

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

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

if (strp.matches(strp) && stru.matches(stru))
{
  Class applet2 = Class.forName("register"); // give complete name of register class including package name
  Applet appletToLoad = (Applet)applet2.newInstance();
  appletToLoad.setStub(this);
  setLayout( new GridLayout(1,0));
  add(appletToLoad);
  appletToLoad.init();
  appletToLoad.start();
}
else
{
   JOptionPane.showMessageDialog(null,"User name or password are not correct.");
   return;
}

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

Applet applet = new TheRealApplet();
applet.setStub(this);
this.setLayout( new BorderLayout() );
add( applet, BorderLayout.CENTER );
applet.init();
applet.start();

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

Applet applet = new CounterThread();
applet.init();
applet.start();

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

public void init() {
  super.init();
  System.err.println("init");
  try {
    URL url = new URL("file:/Users/duns/svn/freehep/vectorgraphics/freehep-graphicsio-emf/TestOffset.emf");
    EMFInputStream is = new EMFInputStream(url.openStream());
    EMFRenderer renderer = new EMFRenderer(is);
    EMFPanel panel = new EMFPanel();
    panel.setRenderer(renderer);
    add(panel);
  } catch (MalformedURLException mfue) {
    System.err.println("URL Malformed "+mfue);
  } catch (IOException ioe) {
    System.err.println("IO Exception "+ioe);
  }
}

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

import java.awt.*;
import java.applet.Applet;
import java.awt.geom.Rectangle2D;
import javax.swing.*;

public class Shapes extends JApplet {
  public static void main(String[] args) {
    JApplet app = new Shapes();
    JFrame f = new JFrame("Example");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    app.init();
    app.start();
    f.add("Center", app);
    f.pack();
    f.setVisible(true);
  }

  Shapes() {
  }

  public void paint(Graphics g) {
    Graphics2D g2d = (Graphics2D) g;
    g2d.drawLine(20, 20, 100, 100);
  }
}

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

AppletStub stub = new AppletStub() {
  // lots of code including defining the parameter 'myParameter'
};
Applet a = new Applet();
a.setStub(stub);
a.init();
// ...

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

import javax.swing.JFrame;
import javax.swing.JApplet;

class TLAppletFrame {

  public static void main(String[] args) {
    JApplet applet = new TLApplet();
    applet.init();

    JFrame frame = new JFrame("Applet in Frame");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add( applet );
    frame.pack();
    frame.setLocationRelativeTo( null );
    frame.setVisible( true );

    applet.start();
  }   
}

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

public void init(Runnable runnable) {
  // recreate lib in background
  setInstance(this);
  Game.setQuestapp(this);
  super.init();
  setLayout(new BorderLayout());
  setBackground(Color.black);
  setFont(mainfont);
  // Game.warn("Focus owned by:
  // "+KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
  // set game in action
  Game.setUserinterface(new Interface());
  Game.thread = new Thread(runnable);
  Game.thread.start();
}

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

public void replace(Applet applet) {
  this.wrappedApplet = applet;
  applet.setStub(this);
  applet.setSize(getWidth(), getHeight());
  this.setLayout(new BorderLayout());
  this.add(applet, "Center");
  applet.init();
  active = true;
  applet.start();
  validate();
}

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

public void replace(Applet applet)
{
  this.applet = applet;
  applet.setStub(this);
  applet.setSize(getWidth(), getHeight());
  
  setLayout(new BorderLayout());
  add(applet, "Center");
  
  applet.init();
  active = true;
  applet.start();
  validate();
}

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

@Override
public void run() {
  showStatus( name + " initializing..." );
  applet.init();
  validate();
  showStatus( name + " starting..." );
  applet.start();
  validate();
  showStatus( name + " running..." );
}

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

public void replace(Applet applet) {
  this.minecraft = applet;
  applet.setStub(this);
  applet.setSize(getWidth(), getHeight());
  setLayout(new BorderLayout());
  add(applet, "Center");
  applet.init();
  this.active = true;
  applet.start();
  validate();
}

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

@Override
public void run() {
showStatus( name + " initializing..." );
applet.init();
validate();
showStatus( name + " starting..." );
applet.start();
validate();
showStatus( name + " running..." );
}

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

AppletFrame(String title, Applet applet, int width, int height)
  {
  super(title);
  this.addWindowListener(new WindowAdapter()
  {
  public void windowClosing(WindowEvent e)
    {
    System.exit(0);
    }
  });
  applet.init();
  applet.setSize(width, height);
  applet.start();
  this.add(applet);
  this.pack();
  this.setVisible(true);
  }
}

相关文章