简体   繁体   English

如何在NetBeans 6.7中更改Applet查看器的维度

[英]How to change the Dimensions of the Applet Viewer in NetBeans 6.7

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 Viewer的维度。

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 ? 如何改变这些尺寸?

Go to the project properties, there you choose Application -> Web Start , select Applet descriptor and click the button Applet Parameters . 转到项目属性,在那里选择Application - > Web Start ,选择Applet描述符 ,然后单击Applet Parameters按钮。 There you can set required dimensions. 在那里你可以设置所需的尺寸。

Or use the Resize() option to change the applet size when you run. 或者使用Resize()选项在运行时更改applet大小。 Put the resize(width,heaght) in init() of your applet. 将调整大小(宽度,大小)放在applet的init()中。

I am using Netbeans 6.9 on Ubuntu 10.10. 我在Ubuntu 10.10上使用Netbeans 6.9。 I also had these problems. 我也有这些问题。 Found the advice from http://kbase.advenci.com/doku.php?id=netbeans_java_applet_startup to work. 找到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. 在NetBeans中创建Java小程序时,NetBeans IDE会自动创建一个关联的HTML文件,该文件控制小程序的启动大小。 If you want to override this, you cannot simply edit the generated HTML file, as it gets overwritten each time the applet is run. 如果要覆盖它,则不能简单地编辑生成的HTML文件,因为每次运行applet时它都会被覆盖。 Do this instead: 改为:

Copy the generated HTML file from the build folder to the src folder, then Edit the HTML file in the src folder as needed. 从生成的HTML文件复制build文件夹复制到src文件夹,然后编辑HTML文件中的src文件夹需要。 This HTML file will function as an override file, and will not be overwritten by the IDE. 此HTML文件将用作override文件,并且不会被IDE覆盖。

That answer is not correct .use the Resize() option to change the applet size when you run. 答案不正确。使用Resize()选项在运行时更改applet大小。 Put the resize(width,heaght) in init() of your applet. 将调整大小(宽度,大小)放在applet的init()中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM