【问题标题】:JApplet: setting the size of the frameJApplet:设置框架的大小
【发布时间】:2011-05-22 15:16:28
【问题描述】:

我读到这是一个棘手的问题,因为小程序在浏览器中运行。但我希望我的小程序窗口始终保持相同的大小。 (现在使用 Eclipse 我可以滑动窗口的大小。)

目前我只这样做:

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

有没有办法添加this.setResizable(false)

【问题讨论】:

    标签: java swing applet japplet


    【解决方案1】:

    在 HTML 中设置小程序的大小。例如

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

    在 AppletViewer 中加载 HTML 时,小程序仍可调整大小,但这与部署无关。

    【讨论】:

      猜你喜欢
      • 2012-09-20
      • 1970-01-01
      • 1970-01-01
      • 2012-01-02
      • 1970-01-01
      • 2021-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多