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

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

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

Applet.setSize介绍

暂无

代码示例

代码示例来源: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: runelite/runelite

client.setSize(size);
client.setPreferredSize(size);
client.getParent().setPreferredSize(size);

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

public void setSize(int w, int h)
  {
  super.setSize(w, h);
  XLEN = w;
  YLEN = h - 50;
  clear_all();
  }

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

public void appletResize(int width, int height) {
  setSize(width, height);
  this.minecraft.setSize(width, height);
}

代码示例来源:origin: IanDarwin/javasrc

void loadApplet(String appletName, int w, int h) {
  // appletName = ... extract from the HTML CODE= somehow ...;
  // width = 		ditto
  // height = 		ditto
  try {
    // get a Class object for the Applet subclass
    ac = Class.forName(appletName);
    // Construct an instance (as if using no-argument constructor)
    ai = (Applet) ac.newInstance();
  } catch(ClassNotFoundException e) {
    showStatus("Applet subclass " + appletName + " did not load");
    return;
  } catch (Exception e ){
    showStatus("Applet " + appletName + " did not instantiate");
    return;
  }
  ai.setSize(w, h);
}

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

validate();
appletSize = applet.getSize();
applet.setSize( width, height );
setVisible(true);

代码示例来源: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

validate();
appletSize = applet.getSize();
applet.setSize( width, height );
setVisible(true);

代码示例来源: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: 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);
  }
}

相关文章