直接运行 Java-applet(不带 html 页面) [英] Run Java-applets directly ( without html page )

查看:29
本文介绍了直接运行 Java-applet(不带 html 页面)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题.

如何在不嵌入网页的情况下直接运行我的 java-applet?

How i can run my java-applet directly without embedded in my web page?

我知道appletViewr可以在没有浏览器的情况下执行applet,但我需要在没有html页面的情况下获取java applet.

I know appletViewr can execute applet without a browser but I need to get java applet without html page.

推荐答案

在您的代码中使用以下代码,其中 AppletClass 是您的 Applet 类.

Use below code with your code, where AppletClass is your Applet class.

AppletClass appletClass = new AppletClass ();

JFrame frame = new JFrame();
frame.setLayout(new GridLayout(1, 1));
frame.add(appletClass );

// Set frame size and other properties
...

// Call applet methods
appletClass .init();
appletClass .start();

frame.setVisible(true);

可以根据需要进行更多自定义.

More customizations can be done as required.

这篇关于直接运行 Java-applet(不带 html 页面)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆