简体   繁体   English

如何从另一个Java文件调用小程序?

[英]How to call an applet from another Java file?

I have a Java file and from that I want to call an applet file. 我有一个Java文件,从那我想调用一个applet文件。

How to do it? 怎么做?

You need something to display the applet in, it won't show itself miraculously somewhere. 您需要一些东西来显示小程序,它不会在某个地方奇迹般地显示自己。

JFrame frame = new JFrame();
frame.getContentPane().add(applet);
frame.setVisible(true);

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

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