JApplet: setting frame size

I read that this is a difficult question because the applet is running in the browser. But I would like my applet window to always keep the same size. (Right now, working with Eclipse, I can shift the window size.)

At the moment, I am only doing this:

public class myJApplet extends JApplet{
  public void init() {
     this.setSize(800, 480);
  }
}

Is there any way to add this.setResizable(false)?

+3
source share
1 answer

Set the applet size in HTML. For instance.

<html>
<body>
<applet code="myJApplet" width="800" height="480">
</applet>
</body>
</html>

The applet will still change when loading HTML in AppletViewer, but this does not apply to deployment.

+4
source

Source: https://habr.com/ru/post/1779324/


All Articles