java 如何在 NetBeans 6.7 中更改 Applet 查看器的尺寸

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1064747/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 15:01:01  来源:igfitidea点击:

How to change the Dimensions of the Applet Viewer in NetBeans 6.7

javanetbeans6.7

提问by Ibn Saeed

I was waiting for the stable release of Netbeans 6.7 before starting to use it for my Java Programming.

在开始将其用于我的 Java 编程之前,我一直在等待 Netbeans 6.7 的稳定版本。

I would like to how to change the Dimensions of the Applet Viewer in NetBeans 6.7.

我想知道如何在 NetBeans 6.7 中更改 Applet 查看器的维度。

When ever i run a java file by pressing SHIFT + F6, it opens an Applet but the dimensions are too small, i think they are around 300 X 300.

当我按 SHIFT + F6 运行 java 文件时,它会打开一个 Applet,但尺寸太小,我认为它们大约为 300 X 300。

How to change those dimensions ?

如何更改这些尺寸?

回答by Aniruddha

Or use the Resize() option to change the applet size when you run. Put the resize(width,heaght) in init() of your applet.

或者在运行时使用 Resize() 选项更改小程序大小。将调整大小(宽度,高度)放在小程序的 init() 中。

回答by Malcolm

Go to the project properties, there you choose Application -> Web Start, select Applet descriptorand click the button Applet Parameters. There you can set required dimensions.

转到项目属性,在那里选择Application -> Web Start,选择Applet descriptor并单击按钮Applet Parameters。您可以在那里设置所需的尺寸。

回答by Joseph McIntyre

I am using Netbeans 6.9 on Ubuntu 10.10. I also had these problems. Found the advice from http://kbase.advenci.com/doku.php?id=netbeans_java_applet_startupto work.

我在 Ubuntu 10.10 上使用 Netbeans 6.9。我也有这些问题。从http://kbase.advenci.com/doku.php?id=netbeans_java_applet_startup找到建议工作。

When you create a Java applet in NetBeans, the NetBeans IDE automatically creates an associated HTML file which controls the startup size of the applet. If you want to override this, you cannot simply edit the generated HTML file, as it gets overwritten each time the applet is run. Do this instead:

在 NetBeans 中创建 Java 小程序时,NetBeans IDE 会自动创建一个关联的 HTML 文件,该文件控制小程序的启动大小。如果您想覆盖它,您不能简单地编辑生成的 HTML 文件,因为每次运行小程序时它都会被覆盖。改为这样做:

Copy the generated HTML file from the buildfolder to the srcfolder, then Edit the HTML file in the srcfolder as needed. This HTML file will function as an overridefile, and will not be overwritten by the IDE.

将生成的 HTML 文件从build文件夹复制到src文件夹,然后src根据需要编辑文件夹中的 HTML 文件。此 HTML 文件将用作override文件,不会被 IDE 覆盖。

回答by NDGO

That answer is not correct .use the Resize() option to change the applet size when you run. Put the resize(width,heaght) in init() of your applet.

该答案不正确。使用 Resize() 选项在运行时更改小程序大小。将调整大小(宽度,高度)放在小程序的 init() 中。